SVN Deploy Script
26 November 2010

Having worked a bit with Ruby on Rails, I've come to appreciate the Capistrano deploy method. Since I also work in PHP and deploy to Linux I recently wrote a bash script to export from SVN to a timestamp named directory with a symbolic link for the webroot.

This allows for very quick code rollbacks by changing the symlink to point to the last working version if a deployment goes wrong. The script allows checking out from trunk or specifying a branch, tag or revision number.

Usage:

#./svndeploy 
#./svndeploy -b [branchname]
#./svndeploy -t [tagname]
#./svndeploy -r [revision number]

The script should live in the directory below the webroot (ie the same directory as the Apache docroot for the specific site).

Download it here

Update: Now with an rsync command to synchronized with the previous release in case there were any assets not under SVN control.