Skip to content
Browse files

Maintenance mode

  • Loading branch information...
1 parent 92014ed commit 696b4bb9561a74b2500e13de2becd042c8b8d8cd @jordanbyron jordanbyron committed Apr 4, 2013
Showing with 59 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +3 −0 Gemfile.lock
  3. +51 −0 app/views/layouts/maintenance.html.erb
  4. +4 −0 config/deploy.rb
View
1 Gemfile
@@ -40,6 +40,7 @@ gem 'rails_setup'
group :development do
gem 'capistrano'
gem 'capistrano_confirm_branch'
+ gem 'capistrano-maintenance'
end
group :assets do
View
3 Gemfile.lock
@@ -40,6 +40,8 @@ GEM
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
+ capistrano-maintenance (0.0.3)
+ capistrano (>= 2.0.0)
capistrano_confirm_branch (0.0.2)
capistrano
capybara (1.1.1)
@@ -261,6 +263,7 @@ PLATFORMS
DEPENDENCIES
albino
capistrano
+ capistrano-maintenance
capistrano_confirm_branch
capybara
capybara-screenshot
View
51 app/views/layouts/maintenance.html.erb
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Maintenance - Practicing Ruby</title>
+ <style type="text/css">
+ body {
+ background-color: #eee;
+ color: #666;
+ font-family: arial, sans-serif;
+ }
+ div#content {
+ width: 500px;
+ margin: 5em auto;
+ text-align: center;
+ background-color: #fff;
+ padding: 2em;
+
+ /* Border Radius */
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ -o-border-radius: 10px;
+ -ms-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ border-radius: 10px;
+
+ /* Shadow */
+ -moz-box-shadow: 0 0 5px #333333;
+ -webkit-box-shadow: 0 0 5px #333333;
+ -o-box-shadow: 0 0 5px #333333;
+ box-shadow: 0 0 5px #333333;
+
+ }
+ a { color: #BD0010; }
+ h1 { font-size: 100%; color: #333; line-height: 1.5em; }
+ h1 span.red { color: #b03c2e; }
+ </style>
+</head>
+<body>
+ <div id="content">
+ <h1><span class="red">Practicing Ruby</span>: Down for Maintenance</h1>
+ <p>
+ Hi Folks! We are down for <%= reason ? reason : "maintenance" %>
+ as of <%= Time.now.utc.strftime("%H:%M %Z") %>.
+ </p>
+ <p>
+ We will be back <%= deadline ? deadline : "shortly" %>.
+ Thanks for visiting!
+ </p>
+ </div>
+</body>
+</html>
View
4 config/deploy.rb
@@ -4,6 +4,7 @@
require 'capistrano/ext/multistage'
require 'bundler/capistrano'
require 'capistrano/confirm_branch'
+require 'capistrano/maintenance'
set :application, "practicing-ruby"
set :repository, "git@github.com:elm-city-craftworks/practicing-ruby-web.git"
@@ -14,6 +15,9 @@
set :use_sudo, false
set :deploy_via, :remote_cache
+set :maintenance_template_path, 'app/views/layouts/maintenance.html.erb'
+set :maintenance_config_warning, false
+
namespace :deploy do
task :restart, :roles => :app do
run "touch #{current_path}/tmp/restart.txt"

0 comments on commit 696b4bb

Please sign in to comment.
Something went wrong with that request. Please try again.