Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
################################################################################# # CAPISTRANO TAG SUPPORT # Provides the ability for capistrano to check out into a named tags directory # Also makes sure that the releases array is properly ordered (not by name but by # modification date). This enables proper rollbacks. # # Author: yan@planyp.us # # Requirements: # set :tag_root, "tags" # where your tags are in relation to trunk/.. # # Usage: TAG=v1.9 cap production deploy # ################################################################################# # Note: you must set :repo_root to the root of your repository (before /trunk) # You may overwrite :tag_root to be 'branches' or 'tags', etc set :tag_root, "branches" #required for svn tag support if ENV['TAG'] # Redefine how capistrano sorts its releases, instead of by name # Sort by modification date, so that we know how to rollback set(:releases) { capture("ls -xt #{releases_path}").split.reverse } set :tag_root, "/#{tag_root}" unless tag_root =~ %r{^/} set :repository, "#{repository.gsub('/trunk', tag_root)}/#{ENV['TAG']}" set :release_name, ENV['TAG'] # Make capistrano write the proper revision # into the REVISION file. require 'capistrano/recipes/deploy/scm/subversion' Capistrano::Deploy::SCM::Subversion.class_eval do def query_revision(revision) return revision if revision =~ /^\d+$/ result = yield(scm(:info, repository, authentication, "-r#{revision}")) YAML.load(result)['Last Changed Rev'] end end end
This paste will be private.
From the Design Piracy series on my blog: