Automatically tagging your releases using Capistrano
September 29th, 2006
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:
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 !
Leave a Reply