Created
December 24, 2014 15:00
-
-
Save kalleth/b241ebdedd02f2b2d7f5 to your computer and use it in GitHub Desktop.
Tag remote in capistrano
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
namespace :deploy do | |
before :restart, :tag do | |
on roles(:app) do | |
within "#{deploy_to}/repo" do | |
execute :git, "tag -f deployed-to-#{fetch(:stage)}" | |
begin | |
execute :git, "remote add upstream #{fetch(:repo_url)}" | |
rescue | |
# The remote might already exist. We don't care if it does. | |
end | |
execute :git, "push -f upstream deployed-to-#{fetch(:stage)}" | |
end | |
end | |
end | |
end |
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
set :stage, 'staging' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment