hanzo 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +5 -4
- data/lib/hanzo/base.rb +1 -1
- data/lib/hanzo/modules/deploy.rb +4 -1
- data/lib/hanzo/version.rb +1 -1
- data/spec/cli/deploy_spec.rb +25 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d58738ec88e49b63d2b3f0363d26a97d8379bf0a
|
4
|
+
data.tar.gz: 2bd4882ff910c81a1524b611b15b3eece82854f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a7a4e52c9db0b82373f56da4f949e96dbc297139c1d6215c0279140cd3b70ee9bba97c6f7fa8d433640d35ffaac984950d616e1c189f739b0782404fd0e0409
|
7
|
+
data.tar.gz: a77b0109b0d6c418f8cb16f323c7212e26ae459a0e40916e80011cb85ae4be5a4751248b5e3e6a5ea15ce7f7c9783e79754d83269ebb34aa8a22b485239790be
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -5,9 +5,10 @@
|
|
5
5
|
<br />
|
6
6
|
Hanzo is a sharp tool to handle deployments of multiple environments of the same application on Heroku.
|
7
7
|
<br /><br />
|
8
|
-
<a href="https://rubygems.org/gems/hanzo"><img src="
|
9
|
-
<a href="https://codeclimate.com/github/mirego/hanzo"><img src="
|
10
|
-
<a href=
|
8
|
+
<a href="https://rubygems.org/gems/hanzo"><img src="http://img.shields.io/gem/v/hanzo.svg" /></a>
|
9
|
+
<a href="https://codeclimate.com/github/mirego/hanzo"><img src="http://img.shields.io/codeclimate/github/mirego/hanzo.svg" /></a>
|
10
|
+
<a href='https://gemnasium.com/mirego/hanzo'><img src="http://img.shields.io/gemnasium/mirego/hanzo.svg" /></a>
|
11
|
+
<a href="https://travis-ci.org/mirego/hanzo"><img src="http://img.shields.io/travis/mirego/hanzo.svg" /></a>
|
11
12
|
</p>
|
12
13
|
|
13
14
|
---
|
@@ -87,7 +88,7 @@ Heroku labs feature for all of them.
|
|
87
88
|
|
88
89
|
## License
|
89
90
|
|
90
|
-
`Hanzo` is © 2017 [Mirego](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/hanzo/blob/master/LICENSE.md) file.
|
91
|
+
`Hanzo` is © 2013-2017 [Mirego](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/hanzo/blob/master/LICENSE.md) file.
|
91
92
|
|
92
93
|
## About Mirego
|
93
94
|
|
data/lib/hanzo/base.rb
CHANGED
data/lib/hanzo/modules/deploy.rb
CHANGED
@@ -45,12 +45,15 @@ module Hanzo
|
|
45
45
|
def run_after_deploy_commands
|
46
46
|
return unless after_deploy_commands.any?
|
47
47
|
|
48
|
+
restart_needed = false
|
49
|
+
|
48
50
|
after_deploy_commands.each do |command|
|
49
51
|
next unless Hanzo.agree("Run `#{command}` on #{@env}?")
|
50
52
|
Hanzo.run "heroku run #{command} --remote #{@env}"
|
53
|
+
restart_needed = true
|
51
54
|
end
|
52
55
|
|
53
|
-
Hanzo.run "heroku ps:restart --remote #{@env}"
|
56
|
+
Hanzo.run "heroku ps:restart --remote #{@env}" if restart_needed
|
54
57
|
end
|
55
58
|
|
56
59
|
def after_deploy_commands
|
data/lib/hanzo/version.rb
CHANGED
data/spec/cli/deploy_spec.rb
CHANGED
@@ -39,14 +39,33 @@ describe Hanzo::CLI do
|
|
39
39
|
let(:deploy_result) { true }
|
40
40
|
|
41
41
|
before do
|
42
|
-
expect(Hanzo).to receive(:agree).with('Run `foo` on production?').and_return(
|
43
|
-
expect(Hanzo).to receive(:
|
44
|
-
expect(Hanzo).to receive(:agree).with('Run `bar` on production?').and_return(true)
|
45
|
-
expect(Hanzo).to receive(:run).with('heroku run bar --remote production')
|
46
|
-
expect(Hanzo).to receive(:run).with('heroku ps:restart --remote production')
|
42
|
+
expect(Hanzo).to receive(:agree).with('Run `foo` on production?').and_return(agree_after_deploy_result)
|
43
|
+
expect(Hanzo).to receive(:agree).with('Run `bar` on production?').and_return(agree_after_deploy_result)
|
47
44
|
end
|
48
45
|
|
49
|
-
|
46
|
+
context 'with after_deploy commands skipped' do
|
47
|
+
let(:agree_after_deploy_result) { false }
|
48
|
+
|
49
|
+
before do
|
50
|
+
expect(Hanzo).not_to receive(:run).with('heroku run foo --remote production')
|
51
|
+
expect(Hanzo).not_to receive(:run).with('heroku run bar --remote production')
|
52
|
+
expect(Hanzo).not_to receive(:run).with('heroku ps:restart --remote production')
|
53
|
+
end
|
54
|
+
|
55
|
+
specify { deploy! }
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'without after_deploy commands skipped' do
|
59
|
+
let(:agree_after_deploy_result) { true }
|
60
|
+
|
61
|
+
before do
|
62
|
+
expect(Hanzo).to receive(:run).with('heroku run foo --remote production')
|
63
|
+
expect(Hanzo).to receive(:run).with('heroku run bar --remote production')
|
64
|
+
expect(Hanzo).to receive(:run).with('heroku ps:restart --remote production')
|
65
|
+
end
|
66
|
+
|
67
|
+
specify { deploy! }
|
68
|
+
end
|
50
69
|
end
|
51
70
|
|
52
71
|
context 'without successful deploy' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanzo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garneau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|