Beruflich Dokumente
Kultur Dokumente
© ThoughtWorks, 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
Configuration
available from
source control,
or via LDAP
or RESTful
Binaries Configuration web service etc.
5
Use several independent testing stages
Unit tests
Functional
Manual
smoke tests
UAT
Binary Functional
Performance
“happy path”
tests
tests
Full functional
GUI tests
test suite
6
Automate deployment,
using slices and virtualisation
Apache 1 WebLogic 1
Apache 2 WebLogic 2
Apache 3 WebLogic 3
..etc ..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
Checkout
Checkout
Checkout
Commit
Commit
Tag
Tag
Tag
QA
Unit Functional
Development Performance Production
Tests Tests
UAT
Environments
Tests, code and Automated build Functional tests are Release candidate is Release
configurations are executes all unit tests automatically tagged and deployed candidate is
created. Some manual and checks in binaries executed against for further testing deployed to
testing occurs binaries production
10