Skip to content

Instantly share code, notes, and snippets.

@BlakeLucchesi
Created November 7, 2012 08:29
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 BlakeLucchesi/4030186 to your computer and use it in GitHub Desktop.
Save BlakeLucchesi/4030186 to your computer and use it in GitHub Desktop.
create a tag.txt file that contains details about the last commit which was deployed to a particular environment.
after "deploy:update_code", "deploy:create_tagfile"
desc "Create a tagfile with the latest tag and commit that was deployed."
task :create_tagfile, :roles => :app do
tagfile = "#{current_release}/public/tag.txt"
run "touch #{tagfile}"
run "cd #{current_release}; echo `git describe --tags` >> #{tagfile};"
run "cd #{current_release}; git log -n 1 >> #{tagfile};"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment