Commit a0336253

mo k <m@mokhan.ca>
2012-01-14 16:50:00
update capistrano deployment to support pushing to staging and prod. 'cap staging deploy' or 'cap production deploy'
1 parent 0cac140
config/deploy.rb
@@ -1,26 +1,21 @@
+set :stages, %w(production staging)
+set :default_stage, "staging"
+require 'capistrano/ext/multistage'
+
 set :application, "www.cakeside.com"
-set :repository,  "git@cakeartist.unfuddle.com:cakeartist/cake.git"
+set :user, "cakeside"
+set :use_sudo, false
 
 set :scm, :git
-# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
+set :repository,  "git@cakeartist.unfuddle.com:cakeartist/cake.git"
 set :deploy_to, "/home/cakeside/apps/#{application}"
-
-role :web, "ec2-107-22-93-60.compute-1.amazonaws.com"                          # Your HTTP server, Apache/etc
-role :app, "ec2-107-22-93-60.compute-1.amazonaws.com"                         # This may be the same as your `Web` server
-role :db,  "ec2-107-22-93-60.compute-1.amazonaws.com", :primary => true # This is where Rails migrations will run
-
-set :user, "cakeside"
-set :use_sudo, false
+set :deploy_via, :remote_cache
 
 $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
 require "rvm/capistrano"                              
 # require 'bundler/capistrano'
 set :rvm_ruby_string, '1.9.2-p290@cakeside'
-# set :rvm_type, :user
 set :rvm_type, :system
-ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "amazon-cakeside", "cakeside.pem")] 
-# if you're still using the script/reaper helper you will need
-# these http://github.com/rails/irs_process_scripts
 
 namespace :deploy do
   task :start, :roles => :app do
.gitignore
@@ -7,3 +7,4 @@ public/uploads/
 db/sphinx/
 log/*
 .DS_Store
+NERD_tree_*
Gemfile
@@ -13,6 +13,7 @@ gem 'thinking-sphinx'
 gem 'fog'
 gem 'kaminari'
 gem 'capistrano'
+gem 'capistrano-ext'
 
 group :development, :test do
   gem 'webrat'
Gemfile.lock
@@ -41,6 +41,8 @@ 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)
     capybara (1.1.2)
       mime-types (>= 1.16)
       nokogiri (>= 1.3.3)
@@ -228,6 +230,7 @@ DEPENDENCIES
   RedCloth
   bcrypt-ruby
   capistrano
+  capistrano-ext
   capybara
   carrierwave
   coffee-rails