rss

Jun
16

Automatically tagging releases with capistrano

Posted (Amit) in Ruby on Rails on 16-06-2008

Even though Capistrano “tags” each release by creating a new folder on the production server(s), it might be interesting to have a historical perspective in your repository anyway. This makes it easier to know exactly what went up for a release. I would like to share the following Capistrano recipe for your pleasure: config/deploy.rb

1
2
3
4
5
6
7
8
 require ‘uri‘
 task :after_deploy do
   source = repository
   dest = URI.parse(repository).merge(“../releases/#{File.basename(release_path)}“)
   cmd = “svn copy –revision=#{revision} –quiet –message \”Auto tagging release #{release_path}\” #{source} #{dest}“
   puts cmd
   `#{cmd}`
 end

First, we start by requiring uri, because Subversion does not like relative URLs. Next, we find the location into which to tag the release, and finally, we just do it. Simple, effective. Enjoy !

Share

Post a comment



Amit Yadav is Stephen Fry proof thanks to caching by WP Super Cache