hanzo 0.4.5 → 0.5
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 +12 -11
- data/Rakefile +10 -0
- data/lib/hanzo.rb +9 -0
- data/lib/hanzo/modules/deploy.rb +2 -2
- data/lib/hanzo/modules/diff.rb +2 -2
- data/lib/hanzo/modules/install.rb +1 -0
- data/lib/hanzo/modules/installers/remotes.rb +1 -5
- data/lib/hanzo/version.rb +1 -1
- data/spec/cli/config_spec.rb +1 -1
- data/spec/cli/install_spec.rb +2 -2
- 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: 803ef303a0cfc9a80e8b5054eebeb94296170084
|
4
|
+
data.tar.gz: c4f0ae51305685c86224f45ab3b6668941e81a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07529e76fcd35dd0e11902cbe46cd93f3c5831fe46d949fc48f615afbc3abd1080f2796b8efe0de4df3ca53bd7ba580dae639cb920c4265f393b65c8d82cb8f2
|
7
|
+
data.tar.gz: 022c69701c64406218bc681857a2e24d75773cd717e608c6edc658b24410980be6b84a591892bde19b895ac8fd07fd66297cf2ca377fc2e7c97171cd16f74c10
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<img src="http://i.imgur.com/RZbJy1u.png" alt="Hanzo" />
|
4
4
|
</a>
|
5
5
|
<br />
|
6
|
-
Hanzo is a sharp tool to handle deployments
|
6
|
+
Hanzo is a sharp tool to handle deployments of multiple environments of the same application on Heroku.
|
7
7
|
<br /><br />
|
8
8
|
<a href="https://rubygems.org/gems/hanzo"><img src="https://badge.fury.io/rb/hanzo.png" /></a>
|
9
9
|
<a href="https://codeclimate.com/github/mirego/hanzo"><img src="https://codeclimate.com/github/mirego/hanzo.png" /></a>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
17
|
-
Add this line to your application’s Gemfile
|
17
|
+
Add this line to your application’s `Gemfile`:
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
gem 'hanzo'
|
@@ -22,18 +22,19 @@ gem 'hanzo'
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
Create an `.
|
26
|
-
|
25
|
+
Create an `.hanzo.yml` file at the root of your app that will contain a map of
|
26
|
+
remotes, with the remote as the key and the Heroku application name as the value.
|
27
27
|
|
28
28
|
```yaml
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
remotes:
|
30
|
+
qa: heroku-app-name-qa
|
31
|
+
staging: heroku-app-name-staging
|
32
|
+
production: heroku-app-name-production
|
32
33
|
```
|
33
34
|
|
34
35
|
### Install remotes
|
35
36
|
|
36
|
-
Whenever you add a new
|
37
|
+
Whenever you add a new remote to your `.hanzo.yml` file, you'll have to install those
|
37
38
|
remotes locally by running `hanzo install`.
|
38
39
|
|
39
40
|
```bash
|
@@ -61,8 +62,8 @@ remotes locally by running `hanzo install`.
|
|
61
62
|
|
62
63
|
### Install labs
|
63
64
|
|
64
|
-
Once all your
|
65
|
-
Heroku labs feature for all
|
65
|
+
Once all your remotes are installed, you might want to enable some
|
66
|
+
Heroku labs feature for all of them.
|
66
67
|
|
67
68
|
```bash
|
68
69
|
> bundle exec hanzo install labs
|
@@ -80,7 +81,7 @@ Heroku labs feature for all your environments.
|
|
80
81
|
|
81
82
|
## License
|
82
83
|
|
83
|
-
`Hanzo` is ©
|
84
|
+
`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.
|
84
85
|
|
85
86
|
## About Mirego
|
86
87
|
|
data/Rakefile
CHANGED
@@ -9,3 +9,13 @@ desc 'Run all specs'
|
|
9
9
|
RSpec::Core::RakeTask.new(:spec) do |task|
|
10
10
|
task.pattern = 'spec/**/*_spec.rb'
|
11
11
|
end
|
12
|
+
|
13
|
+
desc 'Start an IRB session with the gem'
|
14
|
+
task :console do
|
15
|
+
$LOAD_PATH.unshift File.expand_path('..', __FILE__)
|
16
|
+
require 'hanzo'
|
17
|
+
require 'irb'
|
18
|
+
|
19
|
+
ARGV.clear
|
20
|
+
IRB.start
|
21
|
+
end
|
data/lib/hanzo.rb
CHANGED
@@ -55,6 +55,15 @@ module Hanzo
|
|
55
55
|
def self.ask(question, &blk)
|
56
56
|
HighLine.ask "-----> #{question} ", &blk
|
57
57
|
end
|
58
|
+
|
59
|
+
def self.config
|
60
|
+
return YAML.load_file('.hanzo.yml') if File.exist?('.hanzo.yml')
|
61
|
+
|
62
|
+
Hanzo.print 'Cannot locate .hanzo.yml'
|
63
|
+
Hanzo.print 'For more information, please read https://github.com/mirego/hanzo'
|
64
|
+
|
65
|
+
exit
|
66
|
+
end
|
58
67
|
end
|
59
68
|
|
60
69
|
class String
|
data/lib/hanzo/modules/deploy.rb
CHANGED
@@ -22,10 +22,10 @@ module Hanzo
|
|
22
22
|
|
23
23
|
deploy && run_migrations
|
24
24
|
rescue UnknownEnvironment
|
25
|
-
Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .
|
25
|
+
Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .hanzo.yml and run:\n hanzo install remotes", :red
|
26
26
|
Hanzo.unindent_print "\nFor more information, read https://github.com/mirego/hanzo#install-remotes", :red
|
27
27
|
rescue UninstalledEnvironment
|
28
|
-
Hanzo.unindent_print "Environment `#{@env}` has been found in your .
|
28
|
+
Hanzo.unindent_print "Environment `#{@env}` has been found in your .hanzo.yml file. Before using it, you must install it:\n hanzo install remotes", :red
|
29
29
|
end
|
30
30
|
|
31
31
|
def initialize_help
|
data/lib/hanzo/modules/diff.rb
CHANGED
@@ -16,10 +16,10 @@ module Hanzo
|
|
16
16
|
|
17
17
|
diff
|
18
18
|
rescue UnknownEnvironment
|
19
|
-
Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .
|
19
|
+
Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .hanzo.yml and run:\n hanzo install remotes", :red
|
20
20
|
Hanzo.unindent_print "\nFor more information, read https://github.com/mirego/hanzo#install-remotes", :red
|
21
21
|
rescue UninstalledEnvironment
|
22
|
-
Hanzo.unindent_print "Environment `#{@env}` has been found in your .
|
22
|
+
Hanzo.unindent_print "Environment `#{@env}` has been found in your .hanzo.yml file. Before using it, you must install it:\n hanzo install remotes", :red
|
23
23
|
end
|
24
24
|
|
25
25
|
def initialize_help
|
@@ -16,11 +16,7 @@ module Hanzo
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.environments
|
19
|
-
|
20
|
-
|
21
|
-
Hanzo.print 'Cannot locate .heroku-remotes'
|
22
|
-
Hanzo.print 'For more information, please read https://github.com/mirego/hanzo'
|
23
|
-
exit
|
19
|
+
Hanzo.config['remotes']
|
24
20
|
end
|
25
21
|
|
26
22
|
def self.installed_environments
|
data/lib/hanzo/version.rb
CHANGED
data/spec/cli/config_spec.rb
CHANGED
data/spec/cli/install_spec.rb
CHANGED
@@ -39,7 +39,7 @@ describe Hanzo::CLI do
|
|
39
39
|
|
40
40
|
before { expect(Hanzo).to receive(:title).with(create_remotes_title) }
|
41
41
|
|
42
|
-
context '.
|
42
|
+
context '.hanzo.yml exists' do
|
43
43
|
before do
|
44
44
|
expect(Hanzo::Installers::Remotes).to receive(:environments).and_return(heroku_remotes)
|
45
45
|
|
@@ -55,7 +55,7 @@ describe Hanzo::CLI do
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
context '.
|
58
|
+
context '.hanzo.yml file is missing' do
|
59
59
|
before { expect(Hanzo).to receive(:print).twice }
|
60
60
|
|
61
61
|
it 'should display error message' 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: 0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garneau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|