Thursday, October 25, 2007

Deploying with Subversion tags in Capistrano



This is a 0.1 deploy method :) I have tested this and we are using this version in production BUT its is not stupid proof…

In the ./config/deploy.rb

# Setup the repository with the TAG variable ()
tag = (ENV[”TAG”] || “”)
set :repository, “http://svn.mypostit.local/#{application}/tags/#{tag}”
set :repository, “http://svn.mypostit.local/#{application}/trunk” if tag.empty?

Now you can deploy with:
[deployer@heimdull ]# cap deploy TAG=’my_tag’

Wow is that easy.. If the TAG environment variable is empty then it will use the trunk for the repository or else it will use whatever you put in TAG.

I guess I should check if the tag exists before continuing … maybe 0.2 :)

No comments: