From a42274a7a3d4c6ed053b0e4391cd16ef571099de Mon Sep 17 00:00:00 2001 From: Ponomarev Nikolay Date: Sun, 9 Mar 2014 17:16:36 +0400 Subject: [PATCH] Add all available commands in Unicorn to Capistrano tasks --- lib/capistrano/tasks/restart.cap | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/capistrano/tasks/restart.cap b/lib/capistrano/tasks/restart.cap index 4e81f32..38c8364 100644 --- a/lib/capistrano/tasks/restart.cap +++ b/lib/capistrano/tasks/restart.cap @@ -1,8 +1,10 @@ namespace :deploy do - desc 'Restart unicorn application' - task :restart do - on roles(:app), in: :sequence, wait: 5 do - sudo "/etc/init.d/unicorn_#{fetch(:full_app_name)} restart" + desc 'Commands for unicorn application' + %w(start stop force-stop kill_worker restart upgrage reopen-logs).each do |command| + task command.to_sym do + on roles(:app), in: :sequence, wait: 5 do + sudo "/etc/init.d/unicorn_#{fetch(:full_app_name)} #{command}" + end end end end