Skip to content

Instantly share code, notes, and snippets.

@phuesler
Created March 2, 2009 16:30
Show Gist options
  • Save phuesler/72844 to your computer and use it in GitHub Desktop.
Save phuesler/72844 to your computer and use it in GitHub Desktop.
namespace :web do
desc "Custom task to disable web"
task :disable, :roles => :web, :except => {:no_release => true} do
require 'erb'
on_rollback {run "rm #{shared_path}/system/maintenance.html"}
template = File.read(File.join(File.dirname(__FILE__), "deploy", "templates", "maintenance.html.erb"))
result = ERB.new(template).result(binding)
put result, "#{shared_path}/system/maintenance.html", :mode => 0644
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment