jasonrudolph (owner)

Revisions

gist: 137666 Download_button fork
public
Public Clone URL: git://gist.github.com/137666.git
Embed All Files: show embed
tag-cap-deployments-with-git.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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