-
-
Save zporter/3e70b74ce4fe9b8a17bd to your computer and use it in GitHub Desktop.
Capistrano 3: Tag Deploys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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