Skip to content

Instantly share code, notes, and snippets.

@chocnut
Created November 25, 2011 03:57
Show Gist options
  • Save chocnut/1392779 to your computer and use it in GitHub Desktop.
Save chocnut/1392779 to your computer and use it in GitHub Desktop.
deploy.rb
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
require 'bundler/capistrano'
set :application, "staging.xxxx.com"
#set :repository, "."
set :scm, :git
set :repository, "."
set :deploy_via, :copy
# set :port, 16888
#set :scm, :subversion
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :user, :someuser
set :deploy_to, "/var/www/#{application}"
set :use_sudo, false
role :web, "staging.xxxx.com" # Your HTTP server, Apache/etc
role :app, "staging.xxxx.com" # This may be the same as your `Web` server
role :db, "staging.xxxx.com", :primary => true # This is where Rails migrations will run
# role :db, "your slave db-server here"
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment