Created
April 8, 2011 01:01
-
-
Save sentientmonkey/909114 to your computer and use it in GitHub Desktop.
Our deploy for unicorn. It also has magical powers.
This file contains 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_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
namespace :unicorn do | |
desc "start unicorn" | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{try_sudo} bundle exec unicorn_rails -c #{current_path}/config/unicorn-#{rails_env}.rb -E #{rails_env} -D" | |
end | |
desc "stop unicorn" | |
task :stop, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} kill `cat #{unicorn_pid}`" | |
end | |
desc "graceful stop unicorn" | |
task :graceful_stop, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`" | |
end | |
desc "reload unicorn" | |
task :reload, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`" | |
end | |
after "deploy:restart", "unicorn:reload" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment