In your deploy.rb file:
if ENV["SERVER"] && ENV["SERVER"] == "production" set :primary_server, "production.com" set :user, "ben" elsif ENV["SERVER"] && ENV["SERVER"] == "staging" set :primary_server, "staging.local" set :user, "ben" else ... end role :web, primary_server role :app, primary_server role :db, primary_server, :primary => true
The you say:
rake deploy SERVER=staging
Then to deploy to staging its:
But to your live server its: