Forked from vvalgis/Capistrano tasks for starting unicorn.rb
Created
November 23, 2011 15:01
-
-
Save vcastellm/1388897 to your computer and use it in GitHub Desktop.
Capistrano tasks for starting unicorn
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
set :unicorn_binary, "/usr/local/bin/unicorn" | |
set(:unicorn_config) { "#{current_path}/config/unicorn.rb" } | |
set(:unicorn_pid) { "#{deploy_to}/shared/pids/unicorn.pid" } | |
namespace :deploy do | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{default_stage} -D" | |
end | |
task :stop, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} kill `cat #{unicorn_pid}`" | |
end | |
task :graceful_stop, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`" | |
end | |
task :reload, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`" | |
end | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
stop | |
start | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment