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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d58738ec88e49b63d2b3f0363d26a97d8379bf0a
4
- data.tar.gz: 2bd4882ff910c81a1524b611b15b3eece82854f3
3
+ metadata.gz: a3fdfe4074e2f695d32dea1ced3d9543437063c2
4
+ data.tar.gz: 364e464b762238cc38edb434325ec5f2a5becb6e
5
5
  SHA512:
6
- metadata.gz: 6a7a4e52c9db0b82373f56da4f949e96dbc297139c1d6215c0279140cd3b70ee9bba97c6f7fa8d433640d35ffaac984950d616e1c189f739b0782404fd0e0409
7
- data.tar.gz: a77b0109b0d6c418f8cb16f323c7212e26ae459a0e40916e80011cb85ae4be5a4751248b5e3e6a5ea15ce7f7c9783e79754d83269ebb34aa8a22b485239790be
6
+ metadata.gz: 4eb468e8e684e30e2cb56e589f1577aea1c1981a904d57a77193238585b5013a70452e40bcab2ba321f50aa795e8691831696b3e74c2cf6a54a88adaf67b5c06
7
+ data.tar.gz: 94f54a5a792360c4e580a879e0fb0075958b1cda8d25113beda95188438c59753a73456c37dd477cd09ebf3f74cd948e5b789f7b4dd4518f90b9eca9e966cdb2
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Hanzo
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.6.2'.freeze
3
3
  end
@@ -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.1
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-09-13 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler