Build and Release Engineering Its all about automation
Build and Release Engineering It’s all about automation Jez Humble Thought. Works Technologies India Pvt Ltd © Thought. Works, 2006
What is continuous integration? • Keep all your project artefacts in source control (even on a one-person project) • Write a script which builds your software and runs tests on it • Every time you add a feature, check in to source control • Walk over to a machine dedicated to continuous integration, check out the latest version of the code, run the script 2
Why bother? • Dramatically reduces number of bugs - the default state of your application will be “working in a deployment-like environment” • Quick feedback on who broke the app and what changes broke it • Enforces discipline of checking in regularly, therefore less merge hell • Everyone can see what’s happening • Easy to get the latest executable • Makes deployment a snap – therefore quicker feedback from customers • Creates a natural break for you to think and chat to others 3
Automating build and deployment • First of all – get continuous integration working • Then follow the following principles: – 1. Automate testing and deployment – use several independent testing stages if the tests take too long – 2. Check working code in regularly – “continuous” is more often than you think – 3. Deploy the same artefacts in every environment – manage your runtime configuration separately 4
Deploy the same binaries in every environment Software Binaries Configuration available from source control, or via LDAP or RESTful web service etc. 5
Use several independent testing stages Unit tests Functional smoke tests Manual UAT Binary Performance tests GUI tests Functional “happy path” tests Full functional test suite 6
Automate deployment, using slices and virtualisation Apache 1 Web. Logic 1 Apache 2 Web. Logic 2 Apache 3 Web. Logic 3 . . etc 7
Run smoke tests • Can I connect to the DB? • Is my app server cluster up? • Is the right version of my app installed? • Can I send test messages across my messaging bus? • Can I ping external systems? 8
Evolve your production line along with the application it assembles Versioned Repository Source Repository (unit tests, functional tests and code) Configuration Repository (environment specific configuration files) Tag Tag Commit Checkout Commit Package Repository (valid binaries) QA Development Unit Tests Functional Tests Performance Production UAT Environments Tests, code and configurations are created. Some manual testing occurs Automated build executes all unit tests and checks in binaries Functional tests are automatically executed against binaries Release candidate is tagged and deployed for further testing Release candidate is deployed to production Changes move through the automated deployment production line 9
Resources • http: //www. martinfowler. com/articles/continuous. Integration. html • http: //buildix. thoughtworks. com/ • http: //www. jamesshore. com/Blog/Continuous-Integration-on-a-Dollar-a. Day. html • http: //www. scmpatterns. com/ 10
- Slides: 10