easy-deployment 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/CHANGELOG.md +13 -1
- data/README.md +12 -4
- data/easy-deployment.gemspec +3 -3
- data/lib/easy-deployment.rb +3 -2
- data/lib/easy-deployment/version.rb +1 -1
- data/lib/easy/deployment/maintenance.rb +19 -0
- data/lib/easy/generators/backup_generator.rb +1 -0
- data/lib/easy/generators/deployment_generator.rb +1 -0
- data/lib/easy/generators/maintenance_generator.rb +26 -0
- data/lib/easy/generators/templates/maintenance.html.tt +69 -0
- data/lib/easy/generators/templates/maintenance.json.tt +1 -0
- data/lib/easy/generators/templates/maintenance.rb.tt +18 -0
- metadata +24 -17
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NGIzMTY2MzA2MGFkMWUzNmU1ZGU5MWQwNzk2NmUyZTMxOWM0ZmZkYw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9e097e22365db6a37523b417d1df5740798c8da3
|
4
|
+
data.tar.gz: 70a522d246755ae8a1591fe09016e03347ec983a
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NTViNGYzOWRkYmJlZjEyNzMyYjU0NjUzZTkwY2RmYjBjNWZiZDY0MDk4MGE3
|
11
|
-
NzEzMzAxZTU0ZTk4NzZjMGJhYjE5MWQzNmNhNDViMzNkM2IxMzQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NDlkYzI5YjRlYmU4YjIyNGVlYzBjODcxYjBmNWM2YTIyMGM2YzJkZDgzYzg3
|
14
|
-
OTc1NGQxMjk4Njc4MzJkOWJiNzhhN2UwMGZjZTZjODBjY2IyZDdjZDI0ZTYw
|
15
|
-
N2Q0MmE0Njg2NjA0Mjg2ZjQ1YTIyY2RmZTNiMjI2N2M3NmI4Njc=
|
6
|
+
metadata.gz: 59b3756e98ff9240f4957030393eb504f467ae9088b7dadb22340c254f62a4ca4a6bf15e435176bd6ae71734723b0a79f521a1dd30c2c0ea29ec27e82b708304
|
7
|
+
data.tar.gz: d7a1ce0608de54eb62188a203b66d8b8a002f3e4c89841a9944769da6ba5f92cc3ff02b7b2a2034011b9a8ea830d362fb82eee0aa1e703e4aaa8cfd943231a78
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog for easy-deployment
|
2
2
|
|
3
|
+
## 0.6.2 (2015-11-10)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Add support for maintenance mode using the `turnout` gem.
|
8
|
+
|
9
|
+
## 0.6.1 (2014-05-23)
|
10
|
+
|
11
|
+
Minor changes:
|
12
|
+
|
13
|
+
* Update reference data load to use the new rake task from `easy-reference` gem
|
14
|
+
|
3
15
|
## 0.6.0 (2013-11-05)
|
4
16
|
|
5
17
|
Features:
|
@@ -9,7 +21,7 @@ Features:
|
|
9
21
|
|
10
22
|
Bugfixes:
|
11
23
|
|
12
|
-
* Using
|
24
|
+
* Using built-in `easy-reference` gem support now works with a custom bundler path if set.
|
13
25
|
|
14
26
|
## 0.5.3 (2013-09-05)
|
15
27
|
|
data/README.md
CHANGED
@@ -99,12 +99,20 @@ The created backup configuration will be scheduled on deploy to run nightly via
|
|
99
99
|
The default setup is to backup the capistrano system folder, the configured database, to store the backup in S3, and notify of failures via email.
|
100
100
|
All these settings are configurable, to read more see the documentation for the backup gem https://github.com/meskyanichi/backup and setup your configuration to suit yourself.
|
101
101
|
|
102
|
-
###
|
102
|
+
### Maintenance
|
103
103
|
|
104
|
-
|
105
|
-
|
104
|
+
This includes a generator to create a maintenance mode configuration (generator is run by itself as `rails generate easy:maintenace`)
|
105
|
+
|
106
|
+
This will generate:
|
107
|
+
|
108
|
+
config/initializers/maintenace.rb
|
109
|
+
public/maintenance.html
|
110
|
+
public/maintenance.json
|
111
|
+
|
112
|
+
Customise the site configuration within `config/initializers/maintenace.rb` to change the maintenance message, response status etc.
|
113
|
+
Customise the maintenance page within `public/maintenance.html`
|
114
|
+
All these settings are configurable, to read more see the documentation for the turnout gem https://github.com/biola/turnout and setup your configuration to suit yourself.
|
106
115
|
|
107
|
-
require "easy/deployment/whenever"
|
108
116
|
|
109
117
|
## Contributing
|
110
118
|
|
data/easy-deployment.gemspec
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
require File.expand_path('../lib/easy-deployment/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["Jeremy Olliver", "Nigel Ramsay", "Shevaun Coker", "Cameron Fowler"]
|
6
|
-
gem.email = ["jeremy.olliver@abletech.co.nz", "nigel.ramsay@abletech.co.nz", "shevaun.coker@abletech.co.nz", "cameron.fowler@abletech.co.nz"]
|
5
|
+
gem.authors = ["Jeremy Olliver", "Nigel Ramsay", "Shevaun Coker", "Cameron Fowler", "Joseph Leniston"]
|
6
|
+
gem.email = ["jeremy.olliver@abletech.co.nz", "nigel.ramsay@abletech.co.nz", "shevaun.coker@abletech.co.nz", "cameron.fowler@abletech.co.nz", "joseph.leniston@abletech.co.nz"]
|
7
7
|
gem.description = %q{Easy deployment: includes a generator, and capistrano configuration}
|
8
8
|
gem.summary = %q{Gem for encapsulating Abletech's deployment practices}
|
9
9
|
gem.homepage = "https://github.com/AbleTech/easy-deployment"
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.license = "GPLv3"
|
18
18
|
|
19
19
|
gem.add_runtime_dependency 'rails', '>= 3.0.0'
|
20
|
-
gem.add_runtime_dependency 'capistrano', '
|
20
|
+
gem.add_runtime_dependency 'capistrano', '>= 2.15'
|
21
21
|
|
22
22
|
gem.add_development_dependency 'bundler'
|
23
23
|
gem.add_development_dependency 'rspec', '~> 2.0'
|
data/lib/easy-deployment.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "easy-deployment/version"
|
2
|
-
require
|
2
|
+
require 'easy/generators/backup_generator'
|
3
3
|
require 'easy/generators/deployment_generator'
|
4
|
+
require "easy/generators/generator_helpers"
|
5
|
+
require 'easy/generators/maintenance_generator'
|
4
6
|
require 'easy/generators/stage_generator'
|
5
|
-
require 'easy/generators/backup_generator'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Define a capistrano task for putting the site into maintenance mode using
|
2
|
+
# turnout rack middleware.
|
3
|
+
# To load this capistrano configuration, require 'easy/deployment/maintenance' from deploy.rb
|
4
|
+
#
|
5
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
6
|
+
|
7
|
+
namespace :maintenance do
|
8
|
+
desc "Put the application into maintenance mode"
|
9
|
+
task :start, :roles => :app do
|
10
|
+
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake maintenance:start"
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Take the application out of maintenance mode"
|
14
|
+
task :end, :roles => :app do
|
15
|
+
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake maintenance:end"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Easy
|
4
|
+
class MaintenanceGenerator < Rails::Generators::Base
|
5
|
+
source_root File.join(File.dirname(__FILE__), "templates") # Where templates are copied from
|
6
|
+
|
7
|
+
desc %{Generates a maintenance config to allow you to put your application into maintenance mode}
|
8
|
+
|
9
|
+
def create_maintenance_files
|
10
|
+
gem 'turnout', '~> 2.2'
|
11
|
+
|
12
|
+
template("maintenance.rb.tt", "config/initializers/maintenance.rb")
|
13
|
+
template("maintenance.html.tt", "public/maintenance.html")
|
14
|
+
template("maintenance.json.tt", "public/maintenance.json")
|
15
|
+
|
16
|
+
run("bundle install")
|
17
|
+
|
18
|
+
say("Maintenance configuration generated", :green)
|
19
|
+
say(" - TODO: edit config/maintenance.rb setting default_maintenance_page, default_reason and other configuration options", :green)
|
20
|
+
say(" - TODO: edit public/maintenance.html to match site styles", :green)
|
21
|
+
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<title>Down for Maintenance</title>
|
6
|
+
|
7
|
+
<style type="text/css">
|
8
|
+
|
9
|
+
*{
|
10
|
+
font-family: Arial, Helvetica, sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
body{
|
14
|
+
margin: 0;
|
15
|
+
background-color: #fff;
|
16
|
+
}
|
17
|
+
|
18
|
+
#page{
|
19
|
+
position: relative;
|
20
|
+
width: 550px;
|
21
|
+
margin: 200px auto;
|
22
|
+
padding: 75px 0;
|
23
|
+
text-align: center;
|
24
|
+
background-color: #eaeaea;
|
25
|
+
border: solid 1px #ccc;
|
26
|
+
border-top: solid 10px #666;
|
27
|
+
-moz-box-shadow: inset 0 2px 10px #ccc;
|
28
|
+
-webkit-box-shadow: inset 0 2px 10px #ccc;
|
29
|
+
box-shadow: inset 0 2px 10px #ccc;
|
30
|
+
}
|
31
|
+
|
32
|
+
header, #body{
|
33
|
+
width: 400px;
|
34
|
+
margin: 0 auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
h1{
|
38
|
+
margin: 0;
|
39
|
+
color: #CC3601;
|
40
|
+
font-size: 26pt;
|
41
|
+
border-bottom: solid 4px #666;
|
42
|
+
}
|
43
|
+
|
44
|
+
#reason{
|
45
|
+
margin: 10px 0;
|
46
|
+
color: #333;
|
47
|
+
}
|
48
|
+
|
49
|
+
</style>
|
50
|
+
|
51
|
+
</head>
|
52
|
+
<body>
|
53
|
+
|
54
|
+
<section id="page">
|
55
|
+
|
56
|
+
<header>
|
57
|
+
<h1>Down for Maintenance</h1>
|
58
|
+
</header>
|
59
|
+
|
60
|
+
<section id="body">
|
61
|
+
<div>
|
62
|
+
{{ reason }}
|
63
|
+
</div>
|
64
|
+
</section>
|
65
|
+
|
66
|
+
</section>
|
67
|
+
|
68
|
+
</body>
|
69
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
{"error":"Service Unavailable","message":{{ reason }}}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Use this file to easily configure your app in maintenance mode. e.g. Override
|
2
|
+
# the default maintenance.html file with your own.
|
3
|
+
#
|
4
|
+
# See: https://github.com/biola/turnout#configuration for details on customization
|
5
|
+
|
6
|
+
# This is the rails root location, given this file is located at in Rails.root/config/maintenance.rb
|
7
|
+
rails_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
8
|
+
|
9
|
+
|
10
|
+
Turnout.configure do |config|
|
11
|
+
config.app_root = rails_root
|
12
|
+
config.named_maintenance_file_paths = {default: config.app_root.join('tmp', 'maintenance.yml').to_s}
|
13
|
+
config.default_maintenance_page = Turnout::MaintenancePage::HTML
|
14
|
+
config.default_reason = "The site is temporarily down for maintenance.\nPlease check back soon."
|
15
|
+
config.default_allowed_paths = ['/admin','/assets']
|
16
|
+
config.default_response_code = 503
|
17
|
+
config.default_retry_after = 3600
|
18
|
+
end
|
metadata
CHANGED
@@ -1,86 +1,88 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-deployment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Olliver
|
8
8
|
- Nigel Ramsay
|
9
9
|
- Shevaun Coker
|
10
10
|
- Cameron Fowler
|
11
|
+
- Joseph Leniston
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date:
|
15
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: rails
|
18
19
|
requirement: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
20
|
-
- -
|
21
|
+
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
23
|
version: 3.0.0
|
23
24
|
type: :runtime
|
24
25
|
prerelease: false
|
25
26
|
version_requirements: !ruby/object:Gem::Requirement
|
26
27
|
requirements:
|
27
|
-
- -
|
28
|
+
- - ">="
|
28
29
|
- !ruby/object:Gem::Version
|
29
30
|
version: 3.0.0
|
30
31
|
- !ruby/object:Gem::Dependency
|
31
32
|
name: capistrano
|
32
33
|
requirement: !ruby/object:Gem::Requirement
|
33
34
|
requirements:
|
34
|
-
- -
|
35
|
+
- - ">="
|
35
36
|
- !ruby/object:Gem::Version
|
36
|
-
version: 2.
|
37
|
+
version: '2.15'
|
37
38
|
type: :runtime
|
38
39
|
prerelease: false
|
39
40
|
version_requirements: !ruby/object:Gem::Requirement
|
40
41
|
requirements:
|
41
|
-
- -
|
42
|
+
- - ">="
|
42
43
|
- !ruby/object:Gem::Version
|
43
|
-
version: 2.
|
44
|
+
version: '2.15'
|
44
45
|
- !ruby/object:Gem::Dependency
|
45
46
|
name: bundler
|
46
47
|
requirement: !ruby/object:Gem::Requirement
|
47
48
|
requirements:
|
48
|
-
- -
|
49
|
+
- - ">="
|
49
50
|
- !ruby/object:Gem::Version
|
50
51
|
version: '0'
|
51
52
|
type: :development
|
52
53
|
prerelease: false
|
53
54
|
version_requirements: !ruby/object:Gem::Requirement
|
54
55
|
requirements:
|
55
|
-
- -
|
56
|
+
- - ">="
|
56
57
|
- !ruby/object:Gem::Version
|
57
58
|
version: '0'
|
58
59
|
- !ruby/object:Gem::Dependency
|
59
60
|
name: rspec
|
60
61
|
requirement: !ruby/object:Gem::Requirement
|
61
62
|
requirements:
|
62
|
-
- - ~>
|
63
|
+
- - "~>"
|
63
64
|
- !ruby/object:Gem::Version
|
64
65
|
version: '2.0'
|
65
66
|
type: :development
|
66
67
|
prerelease: false
|
67
68
|
version_requirements: !ruby/object:Gem::Requirement
|
68
69
|
requirements:
|
69
|
-
- - ~>
|
70
|
+
- - "~>"
|
70
71
|
- !ruby/object:Gem::Version
|
71
72
|
version: '2.0'
|
72
|
-
description:
|
73
|
+
description: 'Easy deployment: includes a generator, and capistrano configuration'
|
73
74
|
email:
|
74
75
|
- jeremy.olliver@abletech.co.nz
|
75
76
|
- nigel.ramsay@abletech.co.nz
|
76
77
|
- shevaun.coker@abletech.co.nz
|
77
78
|
- cameron.fowler@abletech.co.nz
|
79
|
+
- joseph.leniston@abletech.co.nz
|
78
80
|
executables: []
|
79
81
|
extensions: []
|
80
82
|
extra_rdoc_files: []
|
81
83
|
files:
|
82
|
-
- .gitignore
|
83
|
-
- .rspec
|
84
|
+
- ".gitignore"
|
85
|
+
- ".rspec"
|
84
86
|
- CHANGELOG.md
|
85
87
|
- Gemfile
|
86
88
|
- LICENSE
|
@@ -94,6 +96,7 @@ files:
|
|
94
96
|
- lib/easy/deployment/capistrano.rb
|
95
97
|
- lib/easy/deployment/dbreference.rb
|
96
98
|
- lib/easy/deployment/logrotate.rb
|
99
|
+
- lib/easy/deployment/maintenance.rb
|
97
100
|
- lib/easy/deployment/nfs.rb
|
98
101
|
- lib/easy/deployment/nginx.rb
|
99
102
|
- lib/easy/deployment/niet.rb
|
@@ -102,10 +105,14 @@ files:
|
|
102
105
|
- lib/easy/generators/backup_generator.rb
|
103
106
|
- lib/easy/generators/deployment_generator.rb
|
104
107
|
- lib/easy/generators/generator_helpers.rb
|
108
|
+
- lib/easy/generators/maintenance_generator.rb
|
105
109
|
- lib/easy/generators/stage_generator.rb
|
106
110
|
- lib/easy/generators/templates/Capfile
|
107
111
|
- lib/easy/generators/templates/backup.rb.tt
|
108
112
|
- lib/easy/generators/templates/deploy.rb.tt
|
113
|
+
- lib/easy/generators/templates/maintenance.html.tt
|
114
|
+
- lib/easy/generators/templates/maintenance.json.tt
|
115
|
+
- lib/easy/generators/templates/maintenance.rb.tt
|
109
116
|
- lib/easy/generators/templates/s3.yml
|
110
117
|
- lib/easy/generators/templates/schedule.rb.tt
|
111
118
|
- lib/easy/generators/templates/stage.rb.tt
|
@@ -124,12 +131,12 @@ require_paths:
|
|
124
131
|
- lib
|
125
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
133
|
requirements:
|
127
|
-
- -
|
134
|
+
- - ">="
|
128
135
|
- !ruby/object:Gem::Version
|
129
136
|
version: '0'
|
130
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
138
|
requirements:
|
132
|
-
- -
|
139
|
+
- - ">="
|
133
140
|
- !ruby/object:Gem::Version
|
134
141
|
version: '0'
|
135
142
|
requirements: []
|