Skip to content

Instantly share code, notes, and snippets.

@JoshMcKin
Created January 28, 2011 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JoshMcKin/801081 to your computer and use it in GitHub Desktop.
Save JoshMcKin/801081 to your computer and use it in GitHub Desktop.
Deploy with Thin Rails 3
require "bundler/capistrano"
default_run_options[:pty] = true
set :user, 'user'
set :domain, 'SOMEDOMAIN.OR.IP'
set :application, "applcation_name"
set :repository, "/home/#{user}/git/#{application}.git/"
set :local_repository, "."
set :deploy_to, "/home/#{user}/#{application}"
set :scm, 'git'
set :branch, 'master'
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :git_shallow_clone, 1
set :scm_verbrose, true
set :use_sudo, false
server domain, :app, :web
role :db, domain , :primary => true # This is where Rails migrations will run
#role :db, "your slave db-server here"
# If you are using Passenger mod_rails uncomment this:
# if you're still using the script/reapear helper you will need
# these http://github.com/rails/irs_process_scripts
namespace :deploy do
# task :start {}
# task :stop {}
task :restart, :roles => :app, :except => { :no_release => true } do
run "thin restart -C /home/#{user}/#{application}/current/#{application}.yml --socket /tmp/thin.#{application}.sock"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment