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
This works with Capistrano >= 3.1:
add this line to config/deploy.rb:
set :branch, ENV['BRANCH'] if ENV['BRANCH']
and then call capistrano with:
cap production deploy BRANCH=master
This solution works with Capistrano < 3.1:
# call with cap -s env="" branch="" deploy
set :branch, fetch(:branch, "master")
set :env, fetch(:env, "production")