Skip to content

Instantly share code, notes, and snippets.

@7hunderbird
Created October 22, 2012 21:14
Show Gist options
  • Save 7hunderbird/3934388 to your computer and use it in GitHub Desktop.
Save 7hunderbird/3934388 to your computer and use it in GitHub Desktop.
Act 2
require "bundler/capistrano"
set :application, "awesome"
set :user, "vagrant"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :scm, "git"
set :repository, "[email protected]:7hunderbird/#{application}.git"
set :branch, "master"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
after "deploy", "deploy:cleanup" # keep only the last 5 releases
# -----------------------------------------------------------------------------
# server "192.168.33.10", :web, :app, :db, primary: true
set :staging_database, "awesome_staging"
set :staging_dbhost, "localhost"
task :staging do
role :web, "192.168.33.10"
role :app, "192.168.33.10"
role :db , "192.168.33.10", :primary => true
set :rails_env, "staging"
set :environment_database, defer { staging_database }
set :environment_dbhost, defer { staging_dbhost }
end
set :production_database, "awesome_production"
set :production_dbhost, "localhost"
task :production do
role :web, "192.168.33.11"
role :app, "192.168.33.11"
role :db , "192.168.33.11", :primary => true
set :rails_env, "production"
set :environment_database, defer { production_database }
set :environment_dbhost, defer { production_dbhost }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment