Zero-touch Drupal deployment with Jenkins, Aegir, Git, Fabric and Drush

This time two years ago, I wrote an article called Drupal deployment and workflows with version control, Drush Make and Aegir. It remains my most popular article on my site, according to my stats.

Since then I have discovered the power of Jenkins - heck, it's almost all I write about now :) - and some other cool tools such as Fabric for programming the execution of arbitrary commands on remote servers with SSH.

Recently for some clients, I've been building Jenkins and Fabric-based infrastructure that auto-detects changes pushed to a git repository from dev, and automatically deploys those changes out to Q/A, stage and live servers. The process seems to have an incredible effect on development teams when they realise they barely even have to SSH to any of those remote servers ever again, and let a robot do all the work. People start committing early, committing often, and I'd almost go as far as to say that it makes rolling out changes *fun*.

Recently I took some time to port my fabfiles to do the same auto-deployment to QA, stage and live using standalone Aegir servers. The paradigm works really nicely because in Aegir, a 'migration' of a site onto a new rolling-release build (platform), invokes a backup + rollback functionality out of the box.

I've done a screencast demonstrating the process of taking a change from (theoretically) a local dev environment to test/QA, stage, and live, all by Jenkins 'discovering' the change to the git repo and rolling out instructions to each environment to generate a new build.

The .ogg video can be downloaded here)

The code I use to do the 'deployments' is opensourced at http://github.com/mig5/aegir_cid - feel free to take it and improve upon it!

If Aegir is not your thing, that doesn't rule out Zero-touch deployments: I work with companies who are implementing this with standalone non-Aegir Drupal environments too. Have a look at my whitepaper on Zero-touch deployment if this interests you.

Tags: