Automated django deployment

March 19, 2010 – 17:02

We at 42 Coffee Cups do alot of django projects. Additionally I care about developer staffing, which means one more test project per candidate.

That totals to about 20 commercial and internal projects any time and 10-15 test projects.

That’s not a trivial amount and, given we deploy projects onto testing/staging server after each feature integration, the time spent in deployment is rather big. Last informal survey showed that PM doing the integration work, spends 10% to 50% of his time reviewing and deploying updates!

Of course, we automated it to the point of executing make deploy but I’ve always wondered of other options. Especially given the virtues of Continuous Deployment we would love to enjoy on every project.

Right now under the hood of make deploy we have scripts that

  • tag a version in a git repository
  • create a version archive
  • upload it to server
  • unpack and play with symlinks to mark this version current

What’s missing is:

  • automated db migration
  • automated server restart
  • fallback if something goes wrong
  • automated creation and management of versioned environment

So I’ve researched the area a bit and come down to the following DIY solutions:

Am I missing something, trendy or not?

Perhaps there are commercial (SaaS?) solutions available that I’ve not been able to dig out?

What’s your experience in this regard?

  • http://ckopo.in.ua bsn

    what about using buildbot as CI server?

  • http://a.khavr.com/ Andriy Khavryuchenko

    Though my post was more about deployment stuff, we're using BuildBot (http://buildbot.net/trac) regularly on our projects.

    Now I'm rethinking our CI and deployment process to move towards Continuous Deployment as described by Eric Ries (http://www.startuplessonslearned.com/2009/06/wh…)

    We intent to either continue to use BuildBot or try Hudson (http://hudson-ci.org/) or Pony-Build (http://github.com/jacobian/pony-build-django) for integration part.

  • http://twitter.com/maxua Макс Ищенко

    db migration is tricky.

    To test that “clean slate” deployment continues to work I'd recommend a daily build task that creates a virtualenv –no-site-packages plus pip to install all deps and then run testsuite. Works very well for me.

  • http://a.khavr.com/ Andriy Khavryuchenko

    Daily? We run tests on every checkin :)

  • http://blog.jazkarta.com Nate Aune

    Thanks for the follow @noderabbit! As you know by now, we are building DjangoZoom, a commercial service to streamline and automate Django deployments. It automatically creates the environment on the server using virtualenv, installs all the dependencies using pip, and provides rollback in case something goes wrong. Sign up for the beta at http://djangozoom.com and we'll let you know when it's available!