hanzo 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hanzo/modules/deploy.rb +2 -1
- data/lib/hanzo/version.rb +1 -1
- data/spec/cli/deploy_spec.rb +17 -0
- 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: a3fdfe4074e2f695d32dea1ced3d9543437063c2
|
4
|
+
data.tar.gz: 364e464b762238cc38edb434325ec5f2a5becb6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eb468e8e684e30e2cb56e589f1577aea1c1981a904d57a77193238585b5013a70452e40bcab2ba321f50aa795e8691831696b3e74c2cf6a54a88adaf67b5c06
|
7
|
+
data.tar.gz: 94f54a5a792360c4e580a879e0fb0075958b1cda8d25113beda95188438c59753a73456c37dd477cd09ebf3f74cd948e5b789f7b4dd4518f90b9eca9e966cdb2
|
data/lib/hanzo/modules/deploy.rb
CHANGED
@@ -9,6 +9,7 @@ module Hanzo
|
|
9
9
|
def initialize_variables
|
10
10
|
@env = extract_argument(1)
|
11
11
|
@env ||= Hanzo::Installers::Remotes.environments.keys.first
|
12
|
+
@branch = extract_argument(2)
|
12
13
|
end
|
13
14
|
|
14
15
|
def initialize_cli
|
@@ -37,7 +38,7 @@ module Hanzo
|
|
37
38
|
def deploy
|
38
39
|
validate_environment_existence!
|
39
40
|
|
40
|
-
branch = Hanzo.ask("Branch to deploy in #{@env}:") { |q| q.default = 'HEAD' }
|
41
|
+
branch = @branch || Hanzo.ask("Branch to deploy in #{@env}:") { |q| q.default = 'HEAD' }
|
41
42
|
|
42
43
|
Hanzo.run "git push -f #{@env} #{branch}:master"
|
43
44
|
end
|
data/lib/hanzo/version.rb
CHANGED
data/spec/cli/deploy_spec.rb
CHANGED
@@ -11,6 +11,23 @@ describe Hanzo::CLI do
|
|
11
11
|
expect(Hanzo::Installers::Remotes).to receive(:installed_environments).and_return(['production'])
|
12
12
|
end
|
13
13
|
|
14
|
+
context 'deploy with specific branch' do
|
15
|
+
let(:deploy!) { Hanzo::CLI.new(['deploy', 'production', '2.0.0']) }
|
16
|
+
let(:deploy_command) { "git push -f production 2.0.0:master" }
|
17
|
+
let(:deploy_result) { true }
|
18
|
+
let(:config) { {} }
|
19
|
+
|
20
|
+
before do
|
21
|
+
allow(Hanzo).to receive(:config).and_return(config)
|
22
|
+
expect(Hanzo).not_to receive(:ask)
|
23
|
+
expect(Hanzo).to receive(:run).with(deploy_command).once.and_return(deploy_result)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should git push to heroku upstream' do
|
27
|
+
deploy!
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
14
31
|
context 'successful deploy and without after_deploy commands' do
|
15
32
|
let(:deploy_result) { true }
|
16
33
|
let(:config) { {} }
|
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: 0.6.
|
4
|
+
version: 0.6.2
|
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-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|