Skip to content

Instantly share code, notes, and snippets.

@smathy
Last active December 28, 2015 03:39
Show Gist options
  • Save smathy/7436725 to your computer and use it in GitHub Desktop.
Save smathy/7436725 to your computer and use it in GitHub Desktop.
set :rails_env, ( ENV['RAILS_ENV'] = 'staging' )
set :ssh_name, "stage.#{application}"
desc "Use with deploy to push live"
task :live do
set :rails_env, ( ENV['RAILS_ENV'] = 'production' )
set :ssh_name, "live.#{application}"
end
before 'deploy:setup', :set_server
task :set_server do
server ssh_name, :app, :web, :db, :primary => true
end
# then make sure to add `RAILS_ENV=#{rails_env}` in front of any command line things you're running on the server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment