move newrelic + deploytags gem to production env, rename cap tasks to .rake

This commit is contained in:
Albert Yi
2016-12-06 14:58:39 -08:00
parent 4eb0a64135
commit 9a75a05c25
7 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
namespace :web do
desc "Present a maintenance page to visitors."
task :disable do
on roles(:app) do
maintenance_html_path = "#{current_path}/public/maintenance.html.bak"
if test("[ -e #{maintenance_html_path} ]")
execute :mv, maintenance_html_path, "#{current_path}/public/maintenance.html"
end
end
end
desc "Makes the application web-accessible again."
task :enable do
on roles(:app) do
maintenance_html_path = "#{current_path}/public/maintenance.html"
if test("[ -e #{maintenance_html_path} ]")
execute :mv, maintenance_html_path, "#{current_path}/public/maintenance.html.bak"
end
end
end
end
before "deploy:started", "web:disable"
after "deploy:published", "web:enable"