Your SlideShare is downloading. ×
[ThoughtWorks] Perforce for Release Engineers
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

[ThoughtWorks] Perforce for Release Engineers

227

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
227
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 1  Perforce for Release EngineersLogan McGrathDeveloper ConsultantThoughtWorks
  • 2. 2  Managing ConfigurationHow can configuration be managed as an application goes fromDEV through PROD environments?
  • 3. 3  Movement of Configuration through a PipelineEmail server host configuration
  • 4. 4  Common Configuration Strategies•  All configuration stored in single file•  Specific configuration deployed with application•  Configuration stored in relational database•  Etc...Each strategy has problems!
  • 5. 5  Single Configuration FileApplication is built containing the configuration fileor is co-deployed with the file
  • 6. 6  Configuration File Per EnvironmentThe application is built with an environment-specific configuration file orco-deployed with one.
  • 7. 7  Configuration Database Per EnvironmentThe deployment uses a database to storeconfiguration for the respective environment.
  • 8. 8  Using Perforce for ConfigurationWhy and how Perforce beats all other options
  • 9. 9  Why is Perforce the better choice forapplication configuration?•  Change audit•  Permissions and access control•  Maintained divergence•  Live configuration•  Support for feature toggleshttp://martinfowler.com/bliki/FeatureToggle.html
  • 10. 10  How would application configuration withPerforce work?•  Applications fetch their own configuration overHTTP/REST•  Or config pushed to them•  Configuration stored in plain-text, newline-delimited formats that are human-readable•  XML•  JSON
  • 11. 11  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  • 12. 12  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  • 13. 13  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  • 14. 14  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  • 15. 15  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  • 16. 16  Applications Using the App-Config-AppObtaining runtime configuration from the App-Config-App and ademonstration
  • 17. 17  Application UsageRuntime configuration ofan application using theApp-Config-App
  • 18. 18  Strategies for Propagating Changes•  Applications poll against config MD5 hash forchanges•  App-Config-App notifies applications of changes•  App-Config-App publishes ATOM feed,applications poll for updates then query thechanges
  • 19. 19  Scaling the App-Config-AppHorizontalscaling offoo.com
  • 20. 20  The Internals of the App-Config-AppOverview of architecture and technologies used
  • 21. 21  Tech Choices in Our Proof of Concept•  HTML5 + AngularJS•  Sinatra (Ruby)•  REST interfaces•  Pretty-printed JSON•  Perforce backend - of course!
  • 22. 22  Why JSON and not XML?•  JavaScript: JSON’s natural habitat•  Transparent serialization and deserialization•  Supported everywhere•  Natively in .NET, Ruby, Python, and PHP•  Supported in Java through libraries like Jackson
  • 23. 23  Architecture•  Roughly 100 lines of JavaScript onthe front-end using AngularJS•  Roughly 400 lines of Ruby on theback-end using Sinatra•  Ruby drives all interaction withPerforce server and workingcopy using the p4 commandline clientAngularJS  Sinatra  Perforce  Working  Copy  
  • 24. 24  Architecture•  A different branch is createdin Perforce for eachenvironment the applicationruns in.•  The application fetchesconfiguration stored inPerforce through theApp-Config-App
  • 25. 25  Directory Structure•  dev/•  stack_configuration.json - the configuration•  stack_configuration.html - the form to manipulate it•  stack_configuration.js - additional javascript•  qa/•  uat/•  stage/•  prod/
  • 26. 26  App-Config-App Source
  • 27. 27  
  • 28. 28  
  • 29. 29  
  • 30. 30  
  • 31. 31  
  • 32. 32  Alternative Technologies•  Client-side technology alternatives to AngularJS•  Backbone, Knockout (and 20 others)•  Server-side technology alternatives to Sinatra•  Java•  .NET•  Rails•  PHP•  Python•  Generally, any technology that supports the following capabilities will work:•  HTTP, HTTPS•  JSON over REST•  Driving interaction with Perforce using p4 on the command line
  • 33. 33  Recap•  AngularJS•  Easy client-side•  Sinatra•  Easy server-side•  P4 command line client•  Easy integration with P4D
  • 34. 34  Questions?Logan McGrathlmcgrath@thoughtworks.comwww.thoughtworks.comwww.loganmcgrath.com

×