lib/alpha_omega/deploy.rb in alpha_omega-0.0.114 vs lib/alpha_omega/deploy.rb in alpha_omega-0.0.115

- old
+ new

@@ -118,10 +118,11 @@ _cset(:latest_release) { current_release } # ========================================================================= # deploy:lock defaults # ========================================================================= + _cset(:want_unlock) { true } _cset(:lock_timeout) { 300 } # ========================================================================= # These are helper methods that will be available to your recipes. # ========================================================================= @@ -518,16 +519,24 @@ run_script = <<-SCRIPT echo #{epoch} #{ENV['AO_USER']} > #{log_path}/.#{application}_deploy_lock; SCRIPT - at_exit { self.unlock; } + if want_unlock + at_exit { self.unlock; } + end run run_script.gsub(/[\n\r]+[ \t]+/, " ") end + task :dont_unlock do + set want_unlock, false + end + task :unlock do - run "rm -f #{log_path}/.#{application}_deploy_lock" + if want_unlock + run "rm -f #{log_path}/.#{application}_deploy_lock" + fi end end # :deploy namespace :ruby do