From 8abd94b02da5942ab0ec3e9489709c69796e7299 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 2 Aug 2016 22:14:50 -0700 Subject: [PATCH] add kill step to unicorn cap --- lib/capistrano/tasks/unicorn.cap | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/capistrano/tasks/unicorn.cap b/lib/capistrano/tasks/unicorn.cap index 1b8fc56f8..16efa4576 100644 --- a/lib/capistrano/tasks/unicorn.cap +++ b/lib/capistrano/tasks/unicorn.cap @@ -5,7 +5,16 @@ namespace :unicorn do execute "[[ -n $(pgrep -f unicorn) ]] && pgrep -f unicorn | xargs kill -SIGTERM" 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:stop" after "deploy:published", "unicorn:terminate" +after "deploy:published", "unicorn:kill" after "deploy:published", "unicorn:start"