4

Right now, the current deploy process at my work is based around tagging from the trunk and switching various PHP web sites for clients on our QA and Production servers. While this is simple from the technical level, it becomes really tedious when you have over a dozen updates to a dozen different sites that need to go out in one day.

Towards this end, I'm implementing the following stack:

  • SVN
  • Hudson
  • Capistrano

And it will work like this:

  1. Code goes into svn
  2. svn post-commit hook triggers hudson
  3. hudson runs a capistrano script to deploy to the dev server
  4. project managers check out the dev server, and if the bug is fixed, they go into hudson and promote the build
  5. hudson runs a post-promotion script which tags and deploys the code to whatever server is specified by the promotion

Capistrano (along with the symfony framework) will be used to migrate the databases.

Am I missing anything here? I've never done anything more complicated than subversion before, so that's why I'm asking.

CamelBlues
  • 1,145

3 Answers3

2

One big thing is missing -- how do you roll back if the build fails? Especially, how do you snap shot the database before deploying?

I'm not horribly familiar with Capistrano so it might cover this. But a quick read of the project page doesn't indicate that it does.

Wyatt Barnett
  • 20,787
1

I had almost exactly the same question recently, and I came across this book:

http://www.amazon.co.uk/Expert-PHP-Tools-Dirk-Merkel/dp/1847198384

It is aimed at PHP, but a lot of the processes it describes can be implemented (albeit in similar but slightly different ways) in other languages!

I would say this is a must for any serious developer / development team.

Tom
  • 852
1

Continuous Delivery is a book you should read. But I think you'll find the main advice you'll get from it matches the advice you've had in comments: Use a DVCS instead of SVN, and get your test coverage (unit and integration) sorted out.

I would add to that, use Jenkins instead of Hudson. Oracle now own Hudson and Jenkins was branched from it just before they took over. The open-source support from a very engaged community is likely to out-strip Oracle's support pretty quickly.

pdr
  • 53,768