Created
December 19, 2013 13:30
-
-
Save inferno/8039110 to your computer and use it in GitHub Desktop.
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
| namespace :unicorn do | |
| set :unicorn_pid, "#{app_path}/tmp/pids/unicorn.pid" | |
| desc "Restart unicorn" | |
| task :restart => :environment do | |
| queue %{ | |
| cd #{app_path} | |
| test -s "#{unicorn_pid}" && kill -USR2 `cat "#{unicorn_pid}"` && echo "-----> Reload Ok" && exit 0 | |
| bundle exec unicorn -c #{app_path}/config/unicorn.rb -E #{rails_env} -D && echo "-----> Start Ok" | |
| } | |
| end | |
| desc "Stop unicorn" | |
| task :stop do | |
| queue 'echo "-----> Stop Unicorn"' | |
| queue! %{ | |
| test -s "#{unicorn_pid}" && kill -QUIT `cat "#{unicorn_pid}"` && echo "Stop Ok" && exit 0 | |
| echo >&2 "Not running" | |
| } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment