capistrano-maintenance 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +7 -1
- data/Dangerfile +1 -0
- data/README.md +9 -1
- data/Rakefile +3 -0
- data/capistrano-maintenance.gemspec +1 -0
- data/lib/capistrano-maintenance/version.rb +1 -1
- data/lib/capistrano/tasks/maintenance.rake +19 -10
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6715cb21f27cd1be81fc54884fc95c01ba678a42
|
4
|
+
data.tar.gz: 2ef524d1e52972161859d263c89bb30babd60731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0645b1a1bac92fb1be978303183b67d5040ce6e6a69bc273766cdb63bbf2407d7c17ad74f5d67dfe541b779c986ab8ca67b79a0933be48746c7f2f52a8077f1c
|
7
|
+
data.tar.gz: acf2b89d61e45f500c6dd709a9292583e38633d529e32e152b14d416f7743d9ec3929f5c808623ae048279282563b60bbc08e1d1c21d3bc9ad8670eba596406e
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -4,10 +4,16 @@ Reverse chronological order:
|
|
4
4
|
|
5
5
|
## master
|
6
6
|
|
7
|
-
https://github.com/capistrano/capistrano-maintenance/compare/v1.
|
7
|
+
https://github.com/capistrano/capistrano-maintenance/compare/v1.2.0...HEAD
|
8
8
|
|
9
9
|
* Your contribution here!
|
10
10
|
|
11
|
+
## `1.2.0` (2017-03-10)
|
12
|
+
|
13
|
+
https://github.com/capistrano/capistrano-maintenance/compare/v1.1.0...v1.2.0
|
14
|
+
|
15
|
+
* [#40](https://github.com/capistrano/maintenance/pull/40): Allow directory of maintenance page to be customized - [@tjwallace](https://github.com/tjwallace)
|
16
|
+
|
11
17
|
## `1.1.0` (2017-01-26)
|
12
18
|
|
13
19
|
https://github.com/capistrano/capistrano-maintenance/compare/v1.0.0...v1.1.0
|
data/Dangerfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
danger.import_dangerfile(github: "capistrano/danger")
|
data/README.md
CHANGED
@@ -89,7 +89,7 @@ cap maintenance:enable REASON="hardware upgrade" UNTIL="12pm Central Time"
|
|
89
89
|
```
|
90
90
|
|
91
91
|
You can use a different template for the maintenance page by setting the
|
92
|
-
`:maintenance_template_path` variable in your deploy.rb file with an absolute path.
|
92
|
+
`:maintenance_template_path` variable in your deploy.rb file with an absolute path.
|
93
93
|
|
94
94
|
```
|
95
95
|
set :maintenance_template_path, File.expand_path("../../app/path/to/maintenance.erb.html", __FILE__)
|
@@ -125,6 +125,14 @@ The template file should either be a plaintext or an erb file. For example:
|
|
125
125
|
</html>
|
126
126
|
```
|
127
127
|
|
128
|
+
You can customize which folder the maintenance page template is rendered to by
|
129
|
+
setting the `:maintenance_dirname` variable. By default it renders to
|
130
|
+
`"#{shared_path}/public/system"`.
|
131
|
+
|
132
|
+
```
|
133
|
+
set :maintenance_dirname, -> { "#{current_path}/dist" }
|
134
|
+
```
|
135
|
+
|
128
136
|
By default, the maintenance page will be uploaded to all servers with the `web` role,
|
129
137
|
but if your application has different needs, you can customize this using the
|
130
138
|
`maintenance_roles` variable:
|
data/Rakefile
CHANGED
@@ -1,33 +1,42 @@
|
|
1
1
|
namespace :maintenance do
|
2
2
|
desc "Turn on maintenance mode"
|
3
3
|
task :enable do
|
4
|
-
on fetch(:maintenance_roles
|
4
|
+
on fetch(:maintenance_roles) do
|
5
5
|
require 'erb'
|
6
6
|
|
7
7
|
reason = ENV['REASON']
|
8
8
|
deadline = ENV['UNTIL']
|
9
9
|
|
10
|
-
|
11
|
-
template = fetch(:maintenance_template_path, default_template)
|
12
|
-
result = ERB.new(File.read(template)).result(binding)
|
10
|
+
result = ERB.new(File.read(fetch(:maintenance_template_path))).result(binding)
|
13
11
|
|
14
|
-
rendered_path =
|
15
|
-
rendered_name = "#{fetch(:maintenance_basename
|
12
|
+
rendered_path = fetch(:maintenance_dirname)
|
13
|
+
rendered_name = "#{fetch(:maintenance_basename)}.html"
|
16
14
|
|
17
15
|
if test "[ ! -d #{rendered_path} ]"
|
18
16
|
info 'Creating missing directories.'
|
19
17
|
execute :mkdir, '-pv', rendered_path
|
20
18
|
end
|
21
19
|
|
22
|
-
|
23
|
-
|
20
|
+
rendered_fullpath = "#{rendered_path}/#{rendered_name}"
|
21
|
+
upload! StringIO.new(result), rendered_fullpath
|
22
|
+
execute "chmod 644 #{rendered_fullpath}"
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
27
26
|
desc "Turn off maintenance mode"
|
28
27
|
task :disable do
|
29
|
-
on fetch(:maintenance_roles
|
30
|
-
execute "rm -f #{
|
28
|
+
on fetch(:maintenance_roles) do
|
29
|
+
execute "rm -f #{fetch(:maintenance_dirname)}/#{fetch(:maintenance_basename)}.html"
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|
33
|
+
|
34
|
+
namespace :load do
|
35
|
+
task :defaults do
|
36
|
+
set_if_empty :maintenance_roles, -> { roles(:web) }
|
37
|
+
set_if_empty :maintenance_template_path,
|
38
|
+
File.join(File.expand_path('../../templates', __FILE__), 'maintenance.html.erb')
|
39
|
+
set_if_empty :maintenance_dirname, -> { "#{shared_path}/public/system" }
|
40
|
+
set_if_empty :maintenance_basename, 'maintenance'
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-maintenance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kir Shatrov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: danger
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,7 +74,9 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
63
78
|
- CHANGELOG.md
|
79
|
+
- Dangerfile
|
64
80
|
- Gemfile
|
65
81
|
- LICENSE.txt
|
66
82
|
- README.md
|
@@ -90,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
106
|
version: '0'
|
91
107
|
requirements: []
|
92
108
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.6.
|
109
|
+
rubygems_version: 2.6.10
|
94
110
|
signing_key:
|
95
111
|
specification_version: 4
|
96
112
|
summary: Enable and disabled tasks to show when your project is on maintenance
|