Skip to content

Instantly share code, notes, and snippets.

@7hunderbird
Created October 22, 2012 21:14
Show Gist options
  • Save 7hunderbird/3934390 to your computer and use it in GitHub Desktop.
Save 7hunderbird/3934390 to your computer and use it in GitHub Desktop.
Act 3
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
# -----------------------------------------------------------------------------
set :stages, %w(staging production) set :default_stage, 'staging'
require 'capistrano/ext/multistage'
set :production_database, "awesome_production"
set :production_dbhost, "localhost"
role :web, "192.168.33.11"
role :app, "192.168.33.11"
role :db , "192.168.33.11", :primary => true
set :stage, :production
set :rails_env, "production"
set :environment_database, defer { production_database }
set :environment_dbhost, defer { production_dbhost }
set :staging_database, "awesome_staging"
set :staging_dbhost, "localhost"
role :web, "192.168.33.10"
role :app, "192.168.33.10"
role :db , "192.168.33.10", :primary => true
set :stage, :staging
set :rails_env, "staging"
set :environment_database, defer { staging_database }
set :environment_dbhost, defer { staging_dbhost }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment