gantree 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +28 -26
- data/lib/gantree/cfn/beanstalk.rb +1 -1
- data/lib/gantree/cli.rb +1 -0
- data/lib/gantree/stack.rb +31 -1
- data/lib/gantree/version.rb +1 -1
- 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: 631cf886a62106175b5fddc1e056f59f1c787f13
|
|
4
|
+
data.tar.gz: 5f16f10ae56e2f76c00ed90840a8ab52bfbd009c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ece56a23faa0cd4eebe290a30462c154d71b6dd0c45e6a868e5bedd779d03deeb682730672d5dc70e937cb317a809feae3992c761699cbd8baec0ae534dd72d0
|
|
7
|
+
data.tar.gz: 9d307e4a969733e07147fcbe17deef944873832b4e6fc82863057b2e7f15ecb5f4852ccf5f8e9f252525ce1f85dcaf651937c94cbb812ffef0c66481f6ccf69c
|
data/Gemfile.lock
CHANGED
|
@@ -7,11 +7,11 @@ GEM
|
|
|
7
7
|
aws-sdk-v1 (1.55.0)
|
|
8
8
|
json (~> 1.4)
|
|
9
9
|
nokogiri (>= 1.4.4)
|
|
10
|
-
celluloid (0.
|
|
11
|
-
timers (~>
|
|
10
|
+
celluloid (0.16.0)
|
|
11
|
+
timers (~> 4.0.0)
|
|
12
12
|
cloudformation-ruby-dsl (0.4.6)
|
|
13
13
|
detabulator
|
|
14
|
-
codeclimate-test-reporter (0.4.
|
|
14
|
+
codeclimate-test-reporter (0.4.2)
|
|
15
15
|
simplecov (>= 0.7.1, < 1.0.0)
|
|
16
16
|
coderay (1.1.0)
|
|
17
17
|
colorize (0.7.3)
|
|
@@ -21,9 +21,9 @@ GEM
|
|
|
21
21
|
diff-lcs (1.2.5)
|
|
22
22
|
docile (1.1.5)
|
|
23
23
|
fakeweb (1.3.0)
|
|
24
|
-
ffi (1.9.
|
|
24
|
+
ffi (1.9.6)
|
|
25
25
|
formatador (0.2.5)
|
|
26
|
-
guard (2.
|
|
26
|
+
guard (2.10.1)
|
|
27
27
|
formatador (>= 0.2.4)
|
|
28
28
|
listen (~> 2.7)
|
|
29
29
|
lumberjack (~> 1.0)
|
|
@@ -36,52 +36,54 @@ GEM
|
|
|
36
36
|
guard (~> 2.1)
|
|
37
37
|
rspec (>= 2.14, < 4.0)
|
|
38
38
|
highline (1.6.21)
|
|
39
|
+
hitimes (1.2.2)
|
|
39
40
|
io-like (0.3.0)
|
|
40
41
|
json (1.8.1)
|
|
41
|
-
listen (2.
|
|
42
|
+
listen (2.8.3)
|
|
42
43
|
celluloid (>= 0.15.2)
|
|
43
44
|
rb-fsevent (>= 0.9.3)
|
|
44
45
|
rb-inotify (>= 0.9)
|
|
45
46
|
lumberjack (1.0.9)
|
|
46
47
|
method_source (0.8.2)
|
|
47
|
-
mini_portile (0.6.
|
|
48
|
+
mini_portile (0.6.1)
|
|
48
49
|
multi_json (1.10.1)
|
|
49
50
|
multipart-post (2.0.0)
|
|
50
|
-
nokogiri (1.6.
|
|
51
|
-
mini_portile (
|
|
51
|
+
nokogiri (1.6.5)
|
|
52
|
+
mini_portile (~> 0.6.0)
|
|
52
53
|
pry (0.10.1)
|
|
53
54
|
coderay (~> 1.1.0)
|
|
54
55
|
method_source (~> 0.8.1)
|
|
55
56
|
slop (~> 3.4)
|
|
56
|
-
rake (10.
|
|
57
|
+
rake (10.4.0)
|
|
57
58
|
rb-fsevent (0.9.4)
|
|
58
59
|
rb-inotify (0.9.5)
|
|
59
60
|
ffi (>= 0.5.0)
|
|
60
|
-
rspec (3.
|
|
61
|
-
rspec-core (~> 3.
|
|
62
|
-
rspec-expectations (~> 3.
|
|
63
|
-
rspec-mocks (~> 3.
|
|
64
|
-
rspec-core (3.
|
|
65
|
-
rspec-support (~> 3.
|
|
66
|
-
rspec-expectations (3.
|
|
61
|
+
rspec (3.1.0)
|
|
62
|
+
rspec-core (~> 3.1.0)
|
|
63
|
+
rspec-expectations (~> 3.1.0)
|
|
64
|
+
rspec-mocks (~> 3.1.0)
|
|
65
|
+
rspec-core (3.1.7)
|
|
66
|
+
rspec-support (~> 3.1.0)
|
|
67
|
+
rspec-expectations (3.1.2)
|
|
67
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
68
|
-
rspec-support (~> 3.
|
|
69
|
-
rspec-mocks (3.
|
|
70
|
-
rspec-support (~> 3.
|
|
71
|
-
rspec-support (3.
|
|
72
|
-
safe_yaml (1.0.
|
|
73
|
-
simplecov (0.9.
|
|
69
|
+
rspec-support (~> 3.1.0)
|
|
70
|
+
rspec-mocks (3.1.3)
|
|
71
|
+
rspec-support (~> 3.1.0)
|
|
72
|
+
rspec-support (3.1.2)
|
|
73
|
+
safe_yaml (1.0.4)
|
|
74
|
+
simplecov (0.9.1)
|
|
74
75
|
docile (~> 1.1.0)
|
|
75
|
-
multi_json
|
|
76
|
+
multi_json (~> 1.0)
|
|
76
77
|
simplecov-html (~> 0.8.0)
|
|
77
78
|
simplecov-html (0.8.0)
|
|
78
79
|
slackr (0.0.6)
|
|
79
80
|
multipart-post (~> 2.0.0)
|
|
80
81
|
slop (3.6.0)
|
|
81
82
|
thor (0.19.1)
|
|
82
|
-
timers (
|
|
83
|
+
timers (4.0.1)
|
|
84
|
+
hitimes
|
|
83
85
|
vcr (2.9.3)
|
|
84
|
-
webmock (1.
|
|
86
|
+
webmock (1.20.4)
|
|
85
87
|
addressable (>= 2.3.6)
|
|
86
88
|
crack (>= 0.3.2)
|
|
87
89
|
|
|
@@ -3,7 +3,7 @@ class BeanstalkTemplate
|
|
|
3
3
|
def initialize params
|
|
4
4
|
@stack_name = params[:stack_name]
|
|
5
5
|
@docker_version = params[:docker_version]
|
|
6
|
-
@docker_version ||= "64bit Amazon Linux 2014.09 v1.0.
|
|
6
|
+
@docker_version ||= "64bit Amazon Linux 2014.09 v1.0.10 running Docker 1.3.2"
|
|
7
7
|
@size = params[:instance_size]
|
|
8
8
|
@rds = params[:rds]
|
|
9
9
|
@env = params[:env]
|
data/lib/gantree/cli.rb
CHANGED
|
@@ -41,6 +41,7 @@ module Gantree
|
|
|
41
41
|
|
|
42
42
|
desc "update APP", "update a cfn stack"
|
|
43
43
|
option :dry_run, :aliases => "-d", :desc => "do not actually create the stack"
|
|
44
|
+
option :role, :aliases => "-r", :desc => "add an app role (worker|listner|scheduler)"
|
|
44
45
|
def update app
|
|
45
46
|
Gantree::Stack.new(app, merge_defaults(options)).update
|
|
46
47
|
end
|
data/lib/gantree/stack.rb
CHANGED
|
@@ -41,8 +41,9 @@ module Gantree
|
|
|
41
41
|
|
|
42
42
|
def update
|
|
43
43
|
puts "Updating stack from local cfn repo"
|
|
44
|
+
add_role @options[:role] if @options[:role]
|
|
44
45
|
unless @options[:dry_run] then
|
|
45
|
-
upload_templates
|
|
46
|
+
upload_templates
|
|
46
47
|
@cfm.stacks[@options[:stack_name]].update(:template => stack_template)
|
|
47
48
|
end
|
|
48
49
|
end
|
|
@@ -153,6 +154,35 @@ module Gantree
|
|
|
153
154
|
""
|
|
154
155
|
end
|
|
155
156
|
end
|
|
157
|
+
|
|
158
|
+
def add_role name
|
|
159
|
+
stack_name = @options[:stack_name].sub('app', name)
|
|
160
|
+
beanstalk = JSON.parse(IO.read("cfn/#{@env}-beanstalk.cfn.json"))
|
|
161
|
+
unless beanstalk["Resources"][name] then
|
|
162
|
+
role = {
|
|
163
|
+
"Type" => "AWS::ElasticBeanstalk::Environment",
|
|
164
|
+
"Properties"=> {
|
|
165
|
+
"ApplicationName" => "#{@env}",
|
|
166
|
+
"EnvironmentName" => "#{stack_name}",
|
|
167
|
+
"Description" => "#{name} Environment",
|
|
168
|
+
"VersionLabel" => {
|
|
169
|
+
"Ref" => "ApplicationVersion"
|
|
170
|
+
},
|
|
171
|
+
"TemplateName" => {
|
|
172
|
+
"Ref" => "ConfigurationTemplate"
|
|
173
|
+
},
|
|
174
|
+
"OptionSettings" => []
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
#puts JSON.pretty_generate role
|
|
178
|
+
beanstalk["Resources"]["#{name}".to_sym] = role
|
|
179
|
+
IO.write("cfn/#{@env}-beanstalk.cfn.json", JSON.pretty_generate(beanstalk)) unless @options[:dry_run]
|
|
180
|
+
puts JSON.pretty_generate(beanstalk["Resources"].to_a.last) if @options[:dry_run]
|
|
181
|
+
puts "Added new #{name} role".green
|
|
182
|
+
else
|
|
183
|
+
puts "Role already exists".red
|
|
184
|
+
end
|
|
185
|
+
end
|
|
156
186
|
end
|
|
157
187
|
end
|
|
158
188
|
|
data/lib/gantree/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gantree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Felix
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|