From 2abea662f741acf7c5d94ab798f4f6d853b410f0 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 19 Aug 2012 21:03:39 -0400 Subject: [PATCH] fix a thing --- lib/personal_deity/capistrano.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/personal_deity/capistrano.rb b/lib/personal_deity/capistrano.rb index 916eff2..e24e764 100644 --- a/lib/personal_deity/capistrano.rb +++ b/lib/personal_deity/capistrano.rb @@ -34,11 +34,15 @@ Capistrano::Configuration.instance(true).load do namespace :personal_deity do desc "Install the God config for this app" task :install do - template = ERB.new(File.read(personal_deity_local_app_config)).result(binding) upload_target = personal_deity_config_dir.join("#{application}.god") + + run_personal_deity_command :stop, upload_target.to_s + + template = ERB.new(File.read(personal_deity_local_app_config)).result(binding) top.upload StringIO.new(template), upload_target.to_s run_personal_deity_command :load, upload_target.to_s + run_personal_deity_command :start, upload_target.to_s end namespace :service do @@ -90,13 +94,12 @@ Capistrano::Configuration.instance(true).load do desc "Restart the God process for this application" task :restart do - run_personal_deity_command :restart, application + run_personal_deity_command :stop, application + sleep 3 + run_personal_deity_command :start, application end end - before 'deploy:update_symlink', 'personal_deity:install' - before 'deploy:symlink', 'personal_deity:install' - namespace :deploy do task(:stop) { top.personal_deity.stop } task(:start) { top.personal_deity.start }