Skip to content

Instantly share code, notes, and snippets.

@zporter
Last active July 19, 2016 06:21
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save zporter/3e70b74ce4fe9b8a17bd to your computer and use it in GitHub Desktop.
Save zporter/3e70b74ce4fe9b8a17bd to your computer and use it in GitHub Desktop.
Capistrano 3: Tag Deploys
after 'deploy:restart', 'git:push_deploy_tag'
namespace :git do
task :push_deploy_tag do
on roles(:app) do
user = `git config --get user.name`.chomp
email = `git config --get user.email`.chomp
stage = fetch(:stage)
current_revision = fetch(:current_revision)
info `git tag #{stage}-deploy-#{release_timestamp} #{current_revision} -m "Deployed by #{user} <#{email}>"`
info `git push --tags origin`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment