100 likes | 239 Vues
Build and Release Engineering. It’s all about automation Jez Humble ThoughtWorks Technologies India Pvt Ltd. 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
E N D
Build and Release Engineering It’s all about automation Jez Humble ThoughtWorks Technologies India Pvt Ltd
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
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
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
Deploy the same binaries in every environment Software Configuration available from source control, or via LDAP or RESTful web service etc. Binaries Configuration
Use several independent testing stages Unit tests Functional smoke tests Manual UAT Binary Functional “happy path” tests Performance tests Full functional test suite GUI tests
Automate deployment,using slices and virtualisation Apache 1 WebLogic 1 Apache 2 WebLogic 2 Apache 3 WebLogic 3 ..etc ..etc
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?
Evolve yourproduction line along with the application it assembles Versioned Repository Source Repository (unit tests, functional tests and code) Configuration Repository (environment specific configuration files) Package Repository (valid binaries) Commit Commit Checkout Checkout Checkout Checkout Tag Tag Tag Development Unit Tests Production QA Functional Tests Performance 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
Resources • http://www.martinfowler.com/articles/continuousIntegration.html • http://buildix.thoughtworks.com/ • http://www.jamesshore.com/Blog/Continuous-Integration-on-a-Dollar-a-Day.html • http://www.scmpatterns.com/