Skip to content

Instantly share code, notes, and snippets.

@kalleth
Created December 24, 2014 15:00
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 kalleth/b241ebdedd02f2b2d7f5 to your computer and use it in GitHub Desktop.
Save kalleth/b241ebdedd02f2b2d7f5 to your computer and use it in GitHub Desktop.
Tag remote in capistrano
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
set :stage, 'staging'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment