BeJUG session May 5, Continuous delivery, Axel Fontaine, www.axelfontaine.com
Reliable software solutions through build, test and deployment automation
The take-away message is that automation and agility has improved the development process, but that deployment is still more according to a waterfall model. This can be improved by applying the same kind of agility. It can be done as indicated by sites like stackoverflow (see the version number in the bottom right corner) or flickr (they display it on their tools page).
Green build is top priority!
Don’t check in when the build is red.
Roll back when build is red for too long.
Types of tests:
– typically unit tests
– run entirely in RAM, no db, no network,…
– parallelizable when written properly
– technology oriented
– component tests
– run in RAM but can access local resources like local disk and DB
– slower than small tests but still quite fast
– technology oriented
– black box system tests
– can also cross process boundary
– end-user oriented (which does not need to be human)
Do not deploy snapshots!
What gets deployed?
– code, deployment package, needs deployment script
— environment: put in configuration server (eg LDAP, REST service,…)
— application+environment: deployment package, use environment detection
— application: in the code
— security: file system
– DB delta, in deployment package, LiquiBase or better Flyway (with good maven integration), see also “evolutionary database design” and “refactoring databases”
Branch by abstraction, use a feature switch to allow switching features on/off for development/testing or deployment.
This allows you to continue working on trunk/master.
When new funstionality is done, remove the switch and the old code.
How to allow previous version to be removed “quickly”. Session affinity, all new sessions on new version.
If we assure that session state can be serialized/deserialized between versions, you can store sessions in something like memcache.
The new version can then be switched almost instantly once the new version is up.
Called blue/green deployment.
Deploy using standard package like .msi, .deb, .tar to allow standard deployment tools like puppet, apt etc to be used.
Continuous delivery by Jez Humble