gantree 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gantree.rb +1 -0
- data/lib/gantree/base.rb +1 -0
- data/lib/gantree/cli.rb +10 -29
- data/lib/gantree/config.rb +25 -0
- data/lib/gantree/deploy.rb +1 -1
- data/lib/gantree/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c09441aca3f3edcf71fdda17ddcb33a211bb5626
|
4
|
+
data.tar.gz: ee0db92cf08dc80d4283e03ff45d11c81d2f5fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fae795326dad9be1d7713b45b84a21842f6ab7c1d819df6265daaf72da3fc0267ddd4d03d580e543f3417c29681a2a031ed1c61318394c758ad4d2aa995e2e2e
|
7
|
+
data.tar.gz: b556a99549286699d243004ceccf6cb0ee2cefd48b9ebd79e5d8fc6e2740cb9baf4cdf97c350e4accd5182dabf859ce64759f155532e8149366b9a0bb672a77b
|
data/lib/gantree.rb
CHANGED
data/lib/gantree/base.rb
CHANGED
data/lib/gantree/cli.rb
CHANGED
@@ -20,8 +20,8 @@ module Gantree
|
|
20
20
|
option :auth, :desc => "dockerhub authentation, example: bucket/key"
|
21
21
|
option :release_notes_staging, :type => :boolean, :default => false, :desc => "force release notes generation for staging deploys"
|
22
22
|
def deploy name
|
23
|
-
opts = merge_defaults(options)
|
24
|
-
Gantree::Base.check_for_updates(opts)
|
23
|
+
opts = Gantree::Config.merge_defaults(options)
|
24
|
+
opts = Gantree::Base.check_for_updates(opts)
|
25
25
|
Gantree::Deploy.new(name,opts).run
|
26
26
|
end
|
27
27
|
|
@@ -45,7 +45,7 @@ module Gantree
|
|
45
45
|
option :dupe, :alias => "-d", :desc => "copy an existing template into a new template"
|
46
46
|
option :local, :alias => "-l", :desc => "use a local cfn nested template"
|
47
47
|
def create app
|
48
|
-
Gantree::Create.new(app, merge_defaults(options)).run
|
48
|
+
Gantree::Create.new(app, Gantree::Config.merge_defaults(options)).run
|
49
49
|
end
|
50
50
|
|
51
51
|
desc "update APP", "update a cfn stack"
|
@@ -54,18 +54,18 @@ module Gantree
|
|
54
54
|
option :role, :aliases => "-r", :desc => "add an app role (worker|listner|scheduler)"
|
55
55
|
option :solution, :aliases => "-s", :desc => "change solution stack"
|
56
56
|
def update app
|
57
|
-
Gantree::Update.new(app, merge_defaults(options)).run
|
57
|
+
Gantree::Update.new(app, Gantree::Config.merge_defaults(options)).run
|
58
58
|
end
|
59
59
|
|
60
60
|
desc "delete APP", "delete a cfn stack"
|
61
61
|
option :force, :desc => "do not prompt", :default => false
|
62
62
|
def delete app
|
63
|
-
Gantree::Delete.new(app, merge_defaults(options)).run
|
63
|
+
Gantree::Delete.new(app, Gantree::Config.merge_defaults(options)).run
|
64
64
|
end
|
65
65
|
|
66
66
|
desc "restart APP", "restart an eb app"
|
67
67
|
def restart app
|
68
|
-
Gantree::App.new(app, merge_defaults(options)).restart
|
68
|
+
Gantree::App.new(app, Gantree::Config.merge_defaults(options)).restart
|
69
69
|
end
|
70
70
|
|
71
71
|
desc "build", "build and tag a docker application"
|
@@ -73,7 +73,7 @@ module Gantree
|
|
73
73
|
option :image_path, :aliases => "-i", :desc => "docker hub image path ex. (bleacher/cms | quay.io/bleacherreport/cms)"
|
74
74
|
option :tag, :aliases => "-t", :desc => "set docker tag to build"
|
75
75
|
def build
|
76
|
-
docker = Gantree::Docker.new(merge_defaults(options))
|
76
|
+
docker = Gantree::Docker.new(Gantree::Config.merge_defaults(options))
|
77
77
|
docker.build
|
78
78
|
end
|
79
79
|
|
@@ -83,7 +83,7 @@ module Gantree
|
|
83
83
|
option :image_path, :aliases => "-i", :desc => "docker hub image path ex. (bleacher/cms | quay.io/bleacherreport/cms)"
|
84
84
|
option :tag, :aliases => "-t", :desc => "set docker tag to push"
|
85
85
|
def push
|
86
|
-
Gantree::Docker.new(merge_defaults(options)).push
|
86
|
+
Gantree::Docker.new(Gantree::Config.merge_defaults(options)).push
|
87
87
|
end
|
88
88
|
|
89
89
|
desc "tag", "tag a docker application"
|
@@ -103,8 +103,8 @@ module Gantree
|
|
103
103
|
option :auth, :desc => "dockerhub authentation, example: bucket/key"
|
104
104
|
option :release_notes_staging, :type => :boolean, :default => false, :desc => "force release notes generation for staging deploys"
|
105
105
|
def ship server
|
106
|
-
opts = merge_defaults(options)
|
107
|
-
Gantree::Base.check_for_updates(opts)
|
106
|
+
opts = Gantree::Config.merge_defaults(options)
|
107
|
+
opts = Gantree::Base.check_for_updates(opts)
|
108
108
|
docker = Gantree::Docker.new(opts)
|
109
109
|
docker.pull
|
110
110
|
docker.build
|
@@ -118,25 +118,6 @@ module Gantree
|
|
118
118
|
puts VERSION
|
119
119
|
end
|
120
120
|
|
121
|
-
protected
|
122
|
-
|
123
|
-
def merge_defaults(options={})
|
124
|
-
configs = ["#{ENV['HOME']}/.gantreecfg",".gantreecfg"]
|
125
|
-
hash = {}
|
126
|
-
configs.each do |config|
|
127
|
-
hash.merge!(merge_config(options,config)) if config_exists?(config)
|
128
|
-
end
|
129
|
-
Hash[hash.map{ |k, v| [k.to_sym, v] }]
|
130
|
-
end
|
131
|
-
|
132
|
-
def merge_config options, config
|
133
|
-
defaults = JSON.parse(File.open(config).read)
|
134
|
-
defaults.merge(options)
|
135
|
-
end
|
136
|
-
|
137
|
-
def config_exists? config
|
138
|
-
File.exist? config
|
139
|
-
end
|
140
121
|
end
|
141
122
|
end
|
142
123
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
|
3
|
+
module Gantree
|
4
|
+
class Config
|
5
|
+
class << self
|
6
|
+
def merge_defaults(options={})
|
7
|
+
configs = ["#{ENV['HOME']}/.gantreecfg",".gantreecfg"]
|
8
|
+
hash = {}
|
9
|
+
configs.each do |config|
|
10
|
+
hash.merge!(merge_config(options,config)) if config_exists?(config)
|
11
|
+
end
|
12
|
+
Hash[hash.map{ |k, v| [k.to_sym, v] }]
|
13
|
+
end
|
14
|
+
|
15
|
+
def merge_config options, config
|
16
|
+
defaults = JSON.parse(File.open(config).read)
|
17
|
+
defaults.merge(options)
|
18
|
+
end
|
19
|
+
|
20
|
+
def config_exists? config
|
21
|
+
File.exist? config
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/gantree/deploy.rb
CHANGED
@@ -69,7 +69,7 @@ module Gantree
|
|
69
69
|
create_eb_version
|
70
70
|
update_application(envs)
|
71
71
|
if @options[:slack]
|
72
|
-
msg = "#{ENV['USER']} is deploying #{@packaged_version} to #{@app} "
|
72
|
+
msg = "#{ENV['USER']} is deploying #{@packaged_version} to #{@app} #{@envs.inspect}"
|
73
73
|
msg += "Tag: #{@options[:tag]}" if @options[:tag]
|
74
74
|
Notification.new(@options[:slack]).say(msg) unless @options[:silent]
|
75
75
|
end
|
data/lib/gantree/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gantree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix
|
@@ -304,6 +304,7 @@ files:
|
|
304
304
|
- lib/gantree/cfn/resources.rb
|
305
305
|
- lib/gantree/cli.rb
|
306
306
|
- lib/gantree/cli/help.rb
|
307
|
+
- lib/gantree/config.rb
|
307
308
|
- lib/gantree/create.rb
|
308
309
|
- lib/gantree/delete.rb
|
309
310
|
- lib/gantree/deploy.rb
|