Skip to content

Instantly share code, notes, and snippets.

@jasonrudolph
Created June 29, 2009 15:49
Show Gist options
  • Save jasonrudolph/137666 to your computer and use it in GitHub Desktop.
Save jasonrudolph/137666 to your computer and use it in GitHub Desktop.
after "deploy:restart", "deploy:tag_last_deploy"
namespace :deploy do
# see http://codeintensity.blogspot.com/2008/06/changelogs-and-deployment-notification.html
task :tag_last_deploy do
set :tag_name, "deployed_to_#{rails_env}_#{timestamp_string_without_seconds}"
`git tag -a -m "Tagging deploy to #{rails_env} at #{timestamp_string_without_seconds}" #{tag_name} #{branch}`
`git push --tags`
puts "Tagged release with #{tag_name}."
end
end
def timestamp_string_without_seconds
Time.now.strftime("%Y%m%d%H%M")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment