I am using capistrano to deploy a RoR application. The codebase is in a git repository, and branching is widely used in development. Capistrano uses deploy.rb
f
For capistrano 3 users:
desc "prompt for branch or tag"
task :git_branch_or_tag do
on roles(:all) do |host|
run_locally do
execute :git, 'tag'
tag_prompt = "Enter a branch or tag name to deploy"
ask(:branch_or_tag, tag_prompt)
tag_branch_target = fetch(:branch_or_tag, 'master')
set(:branch, tag_branch_target)
end
end
end
before 'deploy:updated', :git_branch_or_tag