Skip to content

Commit

Permalink
Set up multistage capistrano deployment
Browse files Browse the repository at this point in the history
update gems
add rake to keep Rubymine happy
  • Loading branch information
bryanstearns committed Mar 21, 2012
1 parent db11b19 commit 9736395
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem 'jquery-rails'
gem 'json'
gem 'mysql2'
gem 'rails', '3.2.1'
gem 'rake'
gem 'unicorn'
gem 'delayed_job_active_record'

Expand All @@ -19,6 +20,8 @@ end

group :development do
gem 'capistrano'
gem 'capistrano-ext'
gem 'capistrano-unicorn'
# gem 'ruby-debug'
end

Expand Down
23 changes: 15 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ GEM
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capistrano-ext (1.2.1)
capistrano (>= 1.0.0)
capistrano-unicorn (0.1.6)
capistrano
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
Expand All @@ -55,16 +59,16 @@ GEM
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.0)
railties (>= 3.2.0.beta, < 5.0)
jquery-rails (2.0.1)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.5)
kgio (2.7.2)
mail (2.4.1)
kgio (2.7.3)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.17.2)
mime-types (1.18)
multi_json (1.1.0)
mysql2 (0.3.11)
net-scp (1.0.4)
Expand All @@ -76,7 +80,7 @@ GEM
net-ssh (>= 1.99.1)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
Expand All @@ -102,7 +106,7 @@ GEM
rdoc (3.12)
json (~> 1.4)
sass (3.1.15)
sass-rails (3.2.4)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
Expand All @@ -115,7 +119,7 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.31)
tzinfo (0.3.32)
uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
Expand All @@ -129,12 +133,15 @@ PLATFORMS

DEPENDENCIES
capistrano
capistrano-ext
capistrano-unicorn
coffee-rails (~> 3.2.1)
delayed_job_active_record
jquery-rails
json
mysql2
rails (= 3.2.1)
rake
sass-rails (~> 3.2.3)
uglifier (>= 1.0.3)
unicorn
17 changes: 13 additions & 4 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
set :stages, Dir.glob("config/deploy/*.rb").map{|x| File.basename(x, ".rb")}
set :default_stage, 'hack'
require 'bundler/capistrano'
require 'capistrano/ext/multistage'
require 'fileutils'

set :application, "testapp3"
set :scm, :git
set :repository, "git@github.com:bryanstearns/testapp3.git"
set :repository, "https://github.com/bryanstearns/testapp3.git"

set :copy_exclude, [
".git", ".svn", ".DS_Store", "config/database.yml",
"config/biglietto.yml"
]
set :use_sudo, false

role :web, ""
role :app, ""
role :db, "", :primary => true # This is where Rails migrations will run

# If you are using Passenger mod_rails uncomment this:
# namespace :deploy do
Expand Down
9 changes: 9 additions & 0 deletions config/deploy/hack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Single-machine vagrant-based deployment
# You'll need to bring up the hack box, then do
# (vagrant ssh-config db; vagrant ssh-config web; vagrant ssh-config worker) >>~/.ssh/config
# to make sure capistrano can SSH directly into the running boxes

set :deploy_to, "/var/www/testapp3_production"
set :rails_env, "production"

server "hack", :web, :db, :app, :primary => true
12 changes: 12 additions & 0 deletions config/deploy/live.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Multi-machine vagrant-based deployment
# You'll need to bring up the vagrant boxes, then do
# (vagrant ssh-config db; vagrant ssh-config web; vagrant ssh-config worker) >>~/.ssh/config
# to make sure capistrano can SSH directly into the running boxes

set :deploy_to, "/var/www/testapp3_production"
set :rails_env, "production"

role :web, "web"
role :db, "db", :primary => true
role :app, "worker"

0 comments on commit 9736395

Please sign in to comment.