move newrelic + deploytags gem to production env, rename cap tasks to .rake

This commit is contained in:
Albert Yi
2016-12-06 14:58:39 -08:00
parent 4eb0a64135
commit 9a75a05c25
7 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
namespace :unicorn do
desc "Terminate unicorn processes (blocks until complete)"
task :terminate do
on roles(:app) do
execute "[[ -n $(pgrep -f unicorn) ]] && pgrep -f unicorn | xargs kill -SIGTERM"
sleep(5)
end
end
desc "Kills unicorn processes (blocks until complete)"
task :kill do
on roles(:app) do
execute "[[ -n $(pgrep -f unicorn) ]] && pgrep -f unicorn | xargs kill -SIGKILL"
end
end
end
after "deploy:published", "unicorn:terminate"
after "deploy:published", "unicorn:kill"
after "deploy:published", "unicorn:start"