clean up cap tasks

This commit is contained in:
John Bintz 2012-08-20 11:52:00 -04:00
parent 5a59fd71eb
commit b56ed4a67a

View File

@ -31,6 +31,8 @@ Capistrano::Configuration.instance(true).load do
run generate_personal_deity_command(*args) + "; true" run generate_personal_deity_command(*args) + "; true"
end end
actions = [ :stop, :start, :restart ]
namespace :personal_deity do namespace :personal_deity do
desc "Install the God config for this app" desc "Install the God config for this app"
task :install do task :install do
@ -82,28 +84,18 @@ Capistrano::Configuration.instance(true).load do
end end
end end
desc "Stop the God process for this application" actions.each do |method|
task :stop do desc "#{method.to_s.capitalize} the God process for this application"
run_personal_deity_command :stop, application task(method) do
run_personal_deity_command method, application
end end
desc "Start the God process for this application"
task :start do
run_personal_deity_command :start, application
end
desc "Restart the God process for this application"
task :restart do
run_personal_deity_command :stop, application
sleep 3
run_personal_deity_command :start, application
end end
end end
namespace :deploy do namespace :deploy do
task(:stop) { top.personal_deity.stop } actions.each do |method|
task(:start) { top.personal_deity.start } task(action) { top.personal_deity.send(method) }
task(:restart) { top.personal_deity.restart } end
end end
end end