Clean svn tag support for Capistrano 2
Posted 11 September 2007 @ 7pm | Tagged capistrano, deployment, rails, ruby, RubyOnRails
If you find capistrano’s release directory naming conventions hard to use, a great alternative is to base releases on your svn tags. It turns out that implementing this in cap2 is quite simple. Unfortunately I can’t quite figure out how to turn this into a library so at this point it exists as a cut-n-paste release. Looking for a brave soul to spend a bit more time to turn this into perhaps a deployment recipe.
By reading capistrano source I was able to ferret out the places where I had to make minor adjustments, leading to an implementation in roughly 10 lines of code. All I really had to change was how capistrano sorts releases (using the modification date rather than the name of the directory), and how it determine which revision to write to the REVISION file (by making it grep for the proper field in the svn output). The release name itself and repository location was set using the standard capistrano variable based on the TAG passed in from command line.
The pastie is here capistrano 2 svn tag support.



1 Comment