Skip to content
This repository
Browse code

Maintenance mode

  • Loading branch information...
commit 696b4bb9561a74b2500e13de2becd042c8b8d8cd 1 parent 92014ed
Jordan Byron jordanbyron authored
1  Gemfile
@@ -40,6 +40,7 @@ gem 'rails_setup'
40 40 group :development do
41 41 gem 'capistrano'
42 42 gem 'capistrano_confirm_branch'
  43 + gem 'capistrano-maintenance'
43 44 end
44 45
45 46 group :assets do
3  Gemfile.lock
@@ -40,6 +40,8 @@ GEM
40 40 net-sftp (>= 2.0.0)
41 41 net-ssh (>= 2.0.14)
42 42 net-ssh-gateway (>= 1.1.0)
  43 + capistrano-maintenance (0.0.3)
  44 + capistrano (>= 2.0.0)
43 45 capistrano_confirm_branch (0.0.2)
44 46 capistrano
45 47 capybara (1.1.1)
@@ -261,6 +263,7 @@ PLATFORMS
261 263 DEPENDENCIES
262 264 albino
263 265 capistrano
  266 + capistrano-maintenance
264 267 capistrano_confirm_branch
265 268 capybara
266 269 capybara-screenshot
51 app/views/layouts/maintenance.html.erb
... ... @@ -0,0 +1,51 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>Maintenance - Practicing Ruby</title>
  5 + <style type="text/css">
  6 + body {
  7 + background-color: #eee;
  8 + color: #666;
  9 + font-family: arial, sans-serif;
  10 + }
  11 + div#content {
  12 + width: 500px;
  13 + margin: 5em auto;
  14 + text-align: center;
  15 + background-color: #fff;
  16 + padding: 2em;
  17 +
  18 + /* Border Radius */
  19 + -moz-border-radius: 10px;
  20 + -webkit-border-radius: 10px;
  21 + -o-border-radius: 10px;
  22 + -ms-border-radius: 10px;
  23 + -khtml-border-radius: 10px;
  24 + border-radius: 10px;
  25 +
  26 + /* Shadow */
  27 + -moz-box-shadow: 0 0 5px #333333;
  28 + -webkit-box-shadow: 0 0 5px #333333;
  29 + -o-box-shadow: 0 0 5px #333333;
  30 + box-shadow: 0 0 5px #333333;
  31 +
  32 + }
  33 + a { color: #BD0010; }
  34 + h1 { font-size: 100%; color: #333; line-height: 1.5em; }
  35 + h1 span.red { color: #b03c2e; }
  36 + </style>
  37 +</head>
  38 +<body>
  39 + <div id="content">
  40 + <h1><span class="red">Practicing Ruby</span>: Down for Maintenance</h1>
  41 + <p>
  42 + Hi Folks! We are down for <%= reason ? reason : "maintenance" %>
  43 + as of <%= Time.now.utc.strftime("%H:%M %Z") %>.
  44 + </p>
  45 + <p>
  46 + We will be back <%= deadline ? deadline : "shortly" %>.
  47 + Thanks for visiting!
  48 + </p>
  49 + </div>
  50 +</body>
  51 +</html>
4 config/deploy.rb
@@ -4,6 +4,7 @@
4 4 require 'capistrano/ext/multistage'
5 5 require 'bundler/capistrano'
6 6 require 'capistrano/confirm_branch'
  7 +require 'capistrano/maintenance'
7 8
8 9 set :application, "practicing-ruby"
9 10 set :repository, "git@github.com:elm-city-craftworks/practicing-ruby-web.git"
@@ -14,6 +15,9 @@
14 15 set :use_sudo, false
15 16 set :deploy_via, :remote_cache
16 17
  18 +set :maintenance_template_path, 'app/views/layouts/maintenance.html.erb'
  19 +set :maintenance_config_warning, false
  20 +
17 21 namespace :deploy do
18 22 task :restart, :roles => :app do
19 23 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.