Skip to content

Instantly share code, notes, and snippets.

@joshknowles
Created May 29, 2009 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshknowles/119997 to your computer and use it in GitHub Desktop.
Save joshknowles/119997 to your computer and use it in GitHub Desktop.
after "deploy:update_code", "tag_last_deploy"
task :tag_last_deploy do
if rails_env == 'production'
set :timestamp, Time.now
set :tag_name, "deployed_to_#{rails_env}_#{timestamp.to_i}"
`git pull origin #{branch}`
`git tag -a -m "Tagging deploy to #{rails_env} at #{timestamp}" #{tag_name} origin/#{branch}`
`git push --tags`
puts "Tagged release with #{tag_name}."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment