Skip to content

Commit

Permalink
Merge pull request #7 from itsNikolay/unicorn_tasks
Browse files Browse the repository at this point in the history
Add all available commands in Unicorn to Capistrano tasks
  • Loading branch information
TalkingQuickly committed Apr 16, 2014
2 parents bb4e828 + a42274a commit 54de766
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/capistrano/tasks/restart.cap
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 54de766

Please sign in to comment.