Created
April 23, 2012 20:18
-
-
Save maxmmurphy/2473545 to your computer and use it in GitHub Desktop.
unicorn, rvm and capistrano
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rvm/capistrano" # Load RVM's capistrano plugin. | |
require "bundler/capistrano" | |
set :server, :unicorn | |
set :unicorn_remote_config, "#{shared_path}/config/unicorn.rb" | |
set :unicorn_pid, "#{shared_path}/pids/unicorn.pid" | |
set :rvm_bin_path, "/usr/local/rvm/bin" | |
set :rvm_type, :system | |
namespace :deploy do | |
task :start do | |
run "cd #{current_path} && bundle exec unicorn -c #{unicorn_remote_config} -E #{rails_env} -D" | |
end | |
task :stop do | |
run "kill -QUIT `cat #{unicorn_pid}`" | |
end | |
task :restart do | |
File.exists?(unicorn_pid) ? run("kill -USR2 `cat #{unicorn_pid}`") : start | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment