Permalink
Browse files

Teach deploy:web:enable to fail gracefully

Don't fail if the maintenance files does not exist. This could happen if
multiple web servers share their #{shared_path}/system folder, the rm
would succeed on the first web box and fail on others in this case.
  • Loading branch information...
1 parent 6543a8f commit 22a1c8b7097b1fa602b756f503d17253c0c4e98b @lmarlow committed Feb 21, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/capistrano/recipes/deploy.rb
@@ -546,7 +546,7 @@ def try_runner(*args)
DESC
task :disable, :roles => :web, :except => { :no_release => true } do
require 'erb'
- on_rollback { run "rm #{shared_path}/system/#{maintenance_basename}.html" }
+ on_rollback { run "rm -f #{shared_path}/system/#{maintenance_basename}.html" }
warn <<-EOHTACCESS
@@ -588,7 +588,7 @@ def try_runner(*args)
web-accessible again.
DESC
task :enable, :roles => :web, :except => { :no_release => true } do
- run "rm #{shared_path}/system/#{maintenance_basename}.html"
+ run "rm -f #{shared_path}/system/#{maintenance_basename}.html"
end
end
end

0 comments on commit 22a1c8b

Please sign in to comment.