gantree 0.4.9.2 → 0.4.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gantree
2
2
 
3
- [![Build Status](https://travis-ci.org/feelobot/gantree.svg)](https://travis-ci.org/feelobot/gantree)
3
+ [![Build Status](https://travis-ci.org/feelobot/gantree.svg?branch=master)](https://travis-ci.org/feelobot/gantree)
4
4
  [![Test Coverage](https://codeclimate.com/github/feelobot/gantree/badges/coverage.svg)](https://codeclimate.com/github/feelobot/gantree)
5
5
  [![Code Climate](https://codeclimate.com/github/feelobot/gantree/badges/gpa.svg)](https://codeclimate.com/github/feelobot/gantree)
6
6
  [![Gem Version](https://badge.fury.io/rb/gantree.svg)](http://badge.fury.io/rb/gantree)
@@ -65,6 +65,7 @@ You can also specify a new image tag to use for the deploy
65
65
  gantree deploy -t latest stag-cauldon-app-s1
66
66
  ```
67
67
 
68
+
68
69
  ### Create Stacks
69
70
 
70
71
  Gantree allows you to leverage the power of aws cloud formation to create your entire elastic beanstalk stack, rds, caching layer etc all while maintaining a set naming convention. This does the following:
@@ -74,7 +75,7 @@ Gantree allows you to leverage the power of aws cloud formation to create your e
74
75
 
75
76
  To generate a basic staging cluster for linguist we would do:
76
77
  ```
77
- gantree create stag-linguist-app-s1
78
+ gantree create linguist-stag-s1
78
79
  ```
79
80
 
80
81
  In the elastic beanstalk console you will now see an application called
@@ -85,6 +86,97 @@ You can modify the name of the environment if this does not fit your naming conv
85
86
  gantre create your_app_name -e your_env_name
86
87
  ```
87
88
 
89
+
90
+ ### Ship
91
+
92
+ This command does three things:
93
+
94
+ 1) Builds the image (with an auto generated tag (origin-branch-hash) or custom tag using the -t flag
95
+ 2) Uploads the image based on the --image-path flag or gantree.cfg (ie. hub.docker, quay.io)
96
+ 3) Deploys the image to elastic beanstalk based on command line arguments and cfn files.
97
+
98
+ ```
99
+ # assuming you already ran 'gantree init' and generated the Dockerrun.aws.json file
100
+ gantree ship linguist-stag-s2 -t branch-with-features-and-bug-fixes
101
+ ```
102
+
103
+ ##### Autodetecting environment roles
104
+
105
+ Let's say your linguist app consists of both an app and a worker. The Gantree ship command has an autodetect-app-role flag which will automatically detect the environment's role (app, worker, listener, etc.) by matching the environment name's third dash-delimited string and inject that as a `$ROLE` variable inside the Docker containers.
106
+
107
+ For example, suppose this is the cfn.json file:
108
+
109
+ ```json
110
+ "Properties":{
111
+ "ApplicationName": "linguist-stag-s2",
112
+ "EnvironmentName": "stag-linguist-app-s2",
113
+ ...
114
+ }
115
+
116
+ "Properties":{
117
+ "ApplicationName": "linguist-stag-s2",
118
+ "EnvironmentName": "stag-linguist-worker-s2",
119
+ ...
120
+ }
121
+ ```
122
+
123
+ You can call gantree ship with the autodetect flag
124
+
125
+ ```
126
+ gantree ship linguist-stag-s2 --autodetect-app-role=true -t branch-with-features-and-bug-fixes
127
+ ```
128
+
129
+ Now every environment's Docker container will have the `$ROLE` variable:
130
+
131
+ ```
132
+ # Inside stag-linguist-app-s2 Docker container
133
+ root@adfd4543$ echo $ROLE
134
+ app
135
+
136
+ # Inside stag-linguist-worker-s2 Docker container
137
+ root@afklji231$ echo $ROLE
138
+ worker
139
+ ```
140
+
141
+ As of Gantree version 0.4.9, the autodetect flag default is always on but if your env naming convention doesnt follow the stag-linguist-app-s2 convention, you should turn this off to avoid setting the wrong role variable in the Docker container.
142
+
143
+ ## Update and Create
144
+ As mentioned earlier, Gantree leverages the power of aws cloud formation. The gantree commands `update` and `create` are cloud formation specific gantree commands.
145
+
146
+ ### Update
147
+ We use gantree's `update` command to change an application name, environment name, or other cloud formation changes.
148
+ ```
149
+ # after making changes in your /cfn/*cfn.json files, you want to update the stack
150
+ gantree update linguist-stag-s1
151
+ ```
152
+
153
+ ```
154
+ # You can use the -r flag to easily add a new role to the cnf template
155
+ # Note the dry-run flag is used so we actually don't update the stack, but just changing the cfn files locally
156
+ gantree update linguist-prod-s1 -r worker --dry-run
157
+ ```
158
+
159
+ ### Create
160
+ The gantree `create` command does three things:
161
+
162
+ 1) Creates cfn templates
163
+ 2) Sends them to s3
164
+ 3) Creates the stack
165
+
166
+ ```
167
+ gantree create linguist-prod-s1
168
+
169
+ # you can use the --local flag to skip the first step
170
+ gantree create linguist-prod-s1 --local
171
+ ```
172
+
173
+ We use gantree's `create` command to create a new cfn template from an existing cfn template
174
+
175
+ ```
176
+ # we already have linguist-prod-s1, and we want to create linguist-prod-s2
177
+ gantree create linguist-prod-s2 --dupe linguist-prod-s1
178
+ ```
179
+
88
180
  ### .gantreecfg
89
181
  Allow defaults for commands to be set in a json file
90
182
  ```json
data/lib/gantree/base.rb CHANGED
@@ -33,7 +33,7 @@ module Gantree
33
33
 
34
34
  def tag
35
35
  origin = `git config --get remote.origin.url`.match(":(.*)\/")[1]
36
- branch = `git rev-parse --abbrev-ref HEAD`.strip
36
+ branch = `git rev-parse --abbrev-ref HEAD`.gsub("/", "_").strip
37
37
  hash = `git rev-parse --verify --short #{branch}`.strip
38
38
  "#{origin}-#{branch}-#{hash}"
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module Gantree
2
- VERSION = "0.4.9.2"
2
+ VERSION = "0.4.9.3"
3
3
  end
metadata CHANGED
@@ -1,88 +1,100 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gantree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9.2
4
+ version: 0.4.9.3
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Felix
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
12
+ date: 2015-02-13 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: thor
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ">="
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - ">="
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: aws-sdk-v1
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: 1.55.0
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: 1.55.0
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: hashie
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - ">="
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - ">="
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: colorize
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - ">="
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - ">="
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: rubyzip
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - ">="
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - ">="
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: cloudformation-ruby-dsl
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - '='
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - '='
95
108
  - !ruby/object:Gem::Version
@@ -97,34 +110,39 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: archive-zip
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - "~>"
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
117
  version: 0.7.0
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - "~>"
123
+ - - ~>
109
124
  - !ruby/object:Gem::Version
110
125
  version: 0.7.0
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: json
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - ">="
131
+ - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
133
  version: '0'
118
134
  type: :runtime
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - ">="
139
+ - - ! '>='
123
140
  - !ruby/object:Gem::Version
124
141
  version: '0'
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: slackr
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
147
  - - '='
130
148
  - !ruby/object:Gem::Version
@@ -132,6 +150,7 @@ dependencies:
132
150
  type: :runtime
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
155
  - - '='
137
156
  - !ruby/object:Gem::Version
@@ -139,113 +158,129 @@ dependencies:
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: highline
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
- - - ">="
163
+ - - ! '>='
144
164
  - !ruby/object:Gem::Version
145
165
  version: '0'
146
166
  type: :runtime
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
- - - ">="
171
+ - - ! '>='
151
172
  - !ruby/object:Gem::Version
152
173
  version: '0'
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: pry
155
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
- - - ">="
179
+ - - ! '>='
158
180
  - !ruby/object:Gem::Version
159
181
  version: '0'
160
182
  type: :runtime
161
183
  prerelease: false
162
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
- - - ">="
187
+ - - ! '>='
165
188
  - !ruby/object:Gem::Version
166
189
  version: '0'
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: bundler
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
- - - "~>"
195
+ - - ~>
172
196
  - !ruby/object:Gem::Version
173
197
  version: '1.3'
174
198
  type: :development
175
199
  prerelease: false
176
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
177
202
  requirements:
178
- - - "~>"
203
+ - - ~>
179
204
  - !ruby/object:Gem::Version
180
205
  version: '1.3'
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: rake
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
- - - ">="
211
+ - - ! '>='
186
212
  - !ruby/object:Gem::Version
187
213
  version: '0'
188
214
  type: :development
189
215
  prerelease: false
190
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
191
218
  requirements:
192
- - - ">="
219
+ - - ! '>='
193
220
  - !ruby/object:Gem::Version
194
221
  version: '0'
195
222
  - !ruby/object:Gem::Dependency
196
223
  name: guard
197
224
  requirement: !ruby/object:Gem::Requirement
225
+ none: false
198
226
  requirements:
199
- - - ">="
227
+ - - ! '>='
200
228
  - !ruby/object:Gem::Version
201
229
  version: '0'
202
230
  type: :development
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
205
234
  requirements:
206
- - - ">="
235
+ - - ! '>='
207
236
  - !ruby/object:Gem::Version
208
237
  version: '0'
209
238
  - !ruby/object:Gem::Dependency
210
239
  name: guard-bundler
211
240
  requirement: !ruby/object:Gem::Requirement
241
+ none: false
212
242
  requirements:
213
- - - ">="
243
+ - - ! '>='
214
244
  - !ruby/object:Gem::Version
215
245
  version: '0'
216
246
  type: :development
217
247
  prerelease: false
218
248
  version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
219
250
  requirements:
220
- - - ">="
251
+ - - ! '>='
221
252
  - !ruby/object:Gem::Version
222
253
  version: '0'
223
254
  - !ruby/object:Gem::Dependency
224
255
  name: guard-rspec
225
256
  requirement: !ruby/object:Gem::Requirement
257
+ none: false
226
258
  requirements:
227
- - - ">="
259
+ - - ! '>='
228
260
  - !ruby/object:Gem::Version
229
261
  version: '0'
230
262
  type: :development
231
263
  prerelease: false
232
264
  version_requirements: !ruby/object:Gem::Requirement
265
+ none: false
233
266
  requirements:
234
- - - ">="
267
+ - - ! '>='
235
268
  - !ruby/object:Gem::Version
236
269
  version: '0'
237
270
  - !ruby/object:Gem::Dependency
238
271
  name: vcr
239
272
  requirement: !ruby/object:Gem::Requirement
273
+ none: false
240
274
  requirements:
241
- - - ">="
275
+ - - ! '>='
242
276
  - !ruby/object:Gem::Version
243
277
  version: '0'
244
278
  type: :development
245
279
  prerelease: false
246
280
  version_requirements: !ruby/object:Gem::Requirement
281
+ none: false
247
282
  requirements:
248
- - - ">="
283
+ - - ! '>='
249
284
  - !ruby/object:Gem::Version
250
285
  version: '0'
251
286
  description: cli tool for automating docker deploys to elastic beanstalk
@@ -256,9 +291,9 @@ executables:
256
291
  extensions: []
257
292
  extra_rdoc_files: []
258
293
  files:
259
- - ".gitignore"
260
- - ".ruby-version"
261
- - ".travis.yml"
294
+ - .gitignore
295
+ - .ruby-version
296
+ - .travis.yml
262
297
  - Gemfile
263
298
  - Gemfile.lock
264
299
  - Guardfile
@@ -294,26 +329,27 @@ files:
294
329
  homepage: https://github.com/feelobot/gantree
295
330
  licenses:
296
331
  - MIT
297
- metadata: {}
298
332
  post_install_message:
299
333
  rdoc_options: []
300
334
  require_paths:
301
335
  - lib
302
336
  required_ruby_version: !ruby/object:Gem::Requirement
337
+ none: false
303
338
  requirements:
304
- - - ">="
339
+ - - ! '>='
305
340
  - !ruby/object:Gem::Version
306
341
  version: '0'
307
342
  required_rubygems_version: !ruby/object:Gem::Requirement
343
+ none: false
308
344
  requirements:
309
- - - ">="
345
+ - - ! '>='
310
346
  - !ruby/object:Gem::Version
311
347
  version: '0'
312
348
  requirements: []
313
349
  rubyforge_project:
314
- rubygems_version: 2.2.2
350
+ rubygems_version: 1.8.23.2
315
351
  signing_key:
316
- specification_version: 4
352
+ specification_version: 3
317
353
  summary: This tool is intended to help you setup a Dockerrun.aws.json which allows
318
354
  you to deploy a prebuilt image of your application to Elastic Beanstalk. This also
319
355
  allows you to do versioned deploys to your Elastic Beanstalk application and create
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: fe5aa1695b2783cb4be4a352319a6edbab122367
4
- data.tar.gz: 9c39abc22f8f72d27760890283770dc5985d6d0a
5
- SHA512:
6
- metadata.gz: 5ac5e7bbc6d05613ef8d7b2e8085e44cbbeb8015a66069c1085fc9b0d7c5c46bb231cb5b732876ac02f43a5e0f99e19a127a1b02e92766b2abb36dbfdac9304d
7
- data.tar.gz: 572c16535102d78a285b8b84a50b2b616377ec9eae2dd7a90478906834de51cf428255cd8cfec0bd8c00e49d59166cdb9c91f4eafd0ce872952e9f4eff2b3bfa