ey-core 3.1.8 → 3.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,6 +14,9 @@ module Ey
14
14
  else
15
15
  puts "#{type.capitalize} chef run failed".red
16
16
  ap request
17
+ if server = environment.servers.first
18
+ puts "For logs try `ey logs --server #{server.provisioned_id}` --environment #{environment.name}"
19
+ end
17
20
  end
18
21
  end
19
22
 
@@ -25,7 +28,7 @@ module Ey
25
28
  elsif recipes_path.exist?
26
29
  environment.upload_recipes(archive_directory(path))
27
30
  else
28
- raise RecipesNotFound, "Recipes file not found: #{recipes_path}"
31
+ raise RecipesNotFound, "Recipes not found, expected to find chef recipes in: #{File.expand_path(recipes_path)}"
29
32
  end
30
33
  end
31
34
  end
@@ -35,7 +35,11 @@ DESC
35
35
  abort "Unable to find matching environment".red unless environment
36
36
 
37
37
  servers = if option(:server)
38
- [environment.servers.get(option(:server))] || environment.servers.all(provisioned_id: option(:server))
38
+ if option(:server).match(/i-/)
39
+ environment.servers.all(provisioned_id: option(:server))
40
+ else
41
+ [environment.servers.get(option(:server))].compact
42
+ end
39
43
  else
40
44
  environment.servers.all
41
45
  end
@@ -43,16 +47,20 @@ DESC
43
47
  abort "No servers found".red if servers.empty?
44
48
 
45
49
  servers.each do |server|
46
- name = server.name ? "#{server.name} (#{server.role})" : server.role
50
+ name = [server.provisioned_id, server.name, server.role].compact.join(" ")
47
51
 
48
- if log = server.latest_main_log
52
+ if main_log = server.latest_main_log
49
53
  puts "Main logs for #{name}:".green
50
- puts log.contents
51
- end
52
-
53
- if log = server.latest_custom_log
54
- puts "Custom logs for #{name}:".green
55
- puts log.contents
54
+ puts main_log.contents
55
+ if custom_log = server.latest_custom_log
56
+ #only older stack versions will have custom logs at all, so to avoid showing in-accurate logs, ensure the latest custom log is created (run) chronologically after the latest main log
57
+ if main_log.created_at < custom_log.created_at
58
+ puts "Custom logs for #{name}:".green
59
+ puts custom_log.contents
60
+ end
61
+ end
62
+ else
63
+ puts "No Logs".yellow
56
64
  end
57
65
  end
58
66
  end
@@ -23,72 +23,24 @@ module Ey
23
23
  description: "Name or id of environment",
24
24
  argument: "environment"
25
25
 
26
- switch :main,
27
- short: "m",
28
- long: "main",
29
- description: "Apply main recipes only"
30
-
31
- switch :custom,
32
- short: "u",
33
- long: "custom",
34
- description: "Apply custom recipes only"
35
-
36
26
  switch :quick,
37
27
  short: "q",
38
28
  long: "quick",
39
- description: "Quick chef run"
40
-
41
- switch :full,
42
- short: "f",
43
- long: "full",
44
- description: "Run main and custom chef"
29
+ description: "Quick chef run (if not specified, will run main chef run)"
45
30
 
46
31
  def handle
47
- validate_run_type_flags
48
-
49
32
  operator, environment = core_operator_and_environment_for(options)
50
33
  raise "Unable to find matching environment" unless environment
51
34
 
52
35
  run_chef(run_type, environment)
53
-
54
- if switch_active?(:full)
55
- run_chef("custom", environment)
56
- end
57
36
  end
58
37
 
59
38
  private
60
- def validate_run_type_flags
61
- if active_run_type_flags.length > 1
62
- kernel.abort(
63
- 'Only one of --main, --custom, --quick, and --full may be specified.'
64
- )
65
- end
66
- end
67
39
 
68
40
  def run_type
69
- secondary_run_types[active_run_type] || default_run_type
41
+ (switch_active?(:quick) && "quick") || "main"
70
42
  end
71
43
 
72
- def active_run_type
73
- active_run_type_flags.first
74
- end
75
-
76
- def active_run_type_flags
77
- [:main, :custom, :quick, :full].select {|switch|
78
- switch_active?(switch)
79
- }
80
- end
81
-
82
- def secondary_run_types
83
- {
84
- custom: 'custom',
85
- quick: 'quick'
86
- }
87
- end
88
-
89
- def default_run_type
90
- 'main'
91
- end
92
44
  end
93
45
  end
94
46
  end
@@ -46,11 +46,12 @@ module Ey
46
46
  upload_recipes(environment, path)
47
47
  puts "Uploading custom recipes complete".green
48
48
  rescue => e
49
+ puts e.message
49
50
  abort "There was a problem uploading the recipes".red
50
51
  end
51
52
 
52
53
  if switch_active?(:apply)
53
- run_chef("custom", environment)
54
+ run_chef("main", environment)
54
55
  end
55
56
  end
56
57
  end
@@ -3,7 +3,7 @@ class Ey::Core::Client::Log < Ey::Core::Model
3
3
 
4
4
  identity :id
5
5
 
6
- attribute :created_at
6
+ attribute :created_at, type: :time
7
7
  attribute :filename
8
8
  attribute :mime_type
9
9
  attribute :download_url
@@ -1,5 +1,5 @@
1
1
  module Ey
2
2
  module Core
3
- VERSION = "3.1.8"
3
+ VERSION = "3.1.9"
4
4
  end
5
5
  end
@@ -11,9 +11,7 @@ describe Ey::Core::Cli::Recipes::Apply do
11
11
  and_return(true)
12
12
  end
13
13
 
14
- context 'ey-core recipes apply --main' do
15
- arguments '--main'
16
-
14
+ context 'ey-core recipes apply' do
17
15
  it 'performs a main chef run' do
18
16
  expect(cli).to receive(:run_chef).with('main', environment)
19
17
 
@@ -22,17 +20,6 @@ describe Ey::Core::Cli::Recipes::Apply do
22
20
  end
23
21
  end
24
22
 
25
- context 'ey-core recipes apply --custom' do
26
- arguments '--custom'
27
-
28
- it 'performs a custom chef run' do
29
- expect(cli).to receive(:run_chef).with('custom', environment)
30
-
31
- execute
32
- expect(kernel.exit_status).to eql(0)
33
- end
34
- end
35
-
36
23
  context 'ey-core recipes apply --quick' do
37
24
  arguments '--quick'
38
25
 
@@ -44,35 +31,4 @@ describe Ey::Core::Cli::Recipes::Apply do
44
31
  end
45
32
  end
46
33
 
47
- context 'ey-core recipes apply --full' do
48
- arguments '--full'
49
-
50
- it 'performs both a main and a custom chef run' do
51
- expect(cli).to receive(:run_chef).with('main', environment)
52
- expect(cli).to receive(:run_chef).with('custom', environment)
53
-
54
- execute
55
- expect(kernel.exit_status).to eql(0)
56
- end
57
- end
58
-
59
- context 'attempting to use more than one run type flag' do
60
- let(:run_type_flags) {['--main', '--custom', '--quick', '--full']}
61
- let(:combinations) {run_type_flags.combination(2).to_a}
62
-
63
- it 'aborts with advice regarding the run type flags' do
64
- expect(kernel).
65
- to receive(:abort).
66
- with('Only one of --main, --custom, --quick, and --full may be specified.').
67
- and_call_original.
68
- exactly(combinations.length).
69
- times
70
-
71
- combinations.each do |combination|
72
- attempt = described_class.new(combination, stdin, stdout, stderr, kernel)
73
-
74
- expect(attempt.execute!).not_to eql(0)
75
- end
76
- end
77
- end
78
34
  end
@@ -62,7 +62,7 @@ describe Ey::Core::Cli::Recipes::Upload do
62
62
  arguments '--apply'
63
63
 
64
64
  it 'performs a custom chef run' do
65
- expect(cli).to receive(:run_chef).with('custom', environment)
65
+ expect(cli).to receive(:run_chef).with('main', environment)
66
66
 
67
67
  execute
68
68
  end
metadata CHANGED
@@ -1,321 +1,366 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.8
4
+ version: 3.1.9
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Josh Lane
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-07-11 00:00:00.000000000 Z
12
+ date: 2016-07-19 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: addressable
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '2.2'
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: '2.2'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: awesome_print
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - ">="
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '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: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: belafonte
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: cistern
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.12'
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.12'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: colorize
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: ey-hmac
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - "~>"
99
+ - - ~>
88
100
  - !ruby/object:Gem::Version
89
101
  version: '2.0'
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
96
109
  version: '2.0'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: escape
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'
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'
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: faraday
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.9'
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.9'
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: faraday_middleware
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
- - - "~>"
147
+ - - ~>
130
148
  - !ruby/object:Gem::Version
131
149
  version: '0.9'
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
138
157
  version: '0.9'
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: faye
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: highline
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: json
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
- - - "<"
195
+ - - <
172
196
  - !ruby/object:Gem::Version
173
197
  version: '2.0'
174
198
  type: :runtime
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: '2.0'
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: mime-types
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
- - - "~>"
211
+ - - ~>
186
212
  - !ruby/object:Gem::Version
187
213
  version: '2.99'
188
214
  type: :runtime
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: '2.99'
195
222
  - !ruby/object:Gem::Dependency
196
223
  name: oj
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: :runtime
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: oj_mimic_json
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: :runtime
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: pry
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: :runtime
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: sshkey
239
272
  requirement: !ruby/object:Gem::Requirement
273
+ none: false
240
274
  requirements:
241
- - - "~>"
275
+ - - ~>
242
276
  - !ruby/object:Gem::Version
243
277
  version: '1.6'
244
278
  type: :runtime
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: '1.6'
251
286
  - !ruby/object:Gem::Dependency
252
287
  name: table_print
253
288
  requirement: !ruby/object:Gem::Requirement
289
+ none: false
254
290
  requirements:
255
- - - ">="
291
+ - - ! '>='
256
292
  - !ruby/object:Gem::Version
257
293
  version: '0'
258
294
  type: :runtime
259
295
  prerelease: false
260
296
  version_requirements: !ruby/object:Gem::Requirement
297
+ none: false
261
298
  requirements:
262
- - - ">="
299
+ - - ! '>='
263
300
  - !ruby/object:Gem::Version
264
301
  version: '0'
265
302
  - !ruby/object:Gem::Dependency
266
303
  name: pry-nav
267
304
  requirement: !ruby/object:Gem::Requirement
305
+ none: false
268
306
  requirements:
269
- - - ">="
307
+ - - ! '>='
270
308
  - !ruby/object:Gem::Version
271
309
  version: '0'
272
310
  type: :development
273
311
  prerelease: false
274
312
  version_requirements: !ruby/object:Gem::Requirement
313
+ none: false
275
314
  requirements:
276
- - - ">="
315
+ - - ! '>='
277
316
  - !ruby/object:Gem::Version
278
317
  version: '0'
279
318
  - !ruby/object:Gem::Dependency
280
319
  name: rspec
281
320
  requirement: !ruby/object:Gem::Requirement
321
+ none: false
282
322
  requirements:
283
- - - "~>"
323
+ - - ~>
284
324
  - !ruby/object:Gem::Version
285
325
  version: '3.0'
286
326
  type: :development
287
327
  prerelease: false
288
328
  version_requirements: !ruby/object:Gem::Requirement
329
+ none: false
289
330
  requirements:
290
- - - "~>"
331
+ - - ~>
291
332
  - !ruby/object:Gem::Version
292
333
  version: '3.0'
293
334
  - !ruby/object:Gem::Dependency
294
335
  name: ffaker
295
336
  requirement: !ruby/object:Gem::Requirement
337
+ none: false
296
338
  requirements:
297
- - - ">="
339
+ - - ! '>='
298
340
  - !ruby/object:Gem::Version
299
341
  version: '0'
300
342
  type: :development
301
343
  prerelease: false
302
344
  version_requirements: !ruby/object:Gem::Requirement
345
+ none: false
303
346
  requirements:
304
- - - ">="
347
+ - - ! '>='
305
348
  - !ruby/object:Gem::Version
306
349
  version: '0'
307
350
  - !ruby/object:Gem::Dependency
308
351
  name: rake
309
352
  requirement: !ruby/object:Gem::Requirement
353
+ none: false
310
354
  requirements:
311
- - - ">="
355
+ - - ! '>='
312
356
  - !ruby/object:Gem::Version
313
357
  version: '0'
314
358
  type: :development
315
359
  prerelease: false
316
360
  version_requirements: !ruby/object:Gem::Requirement
361
+ none: false
317
362
  requirements:
318
- - - ">="
363
+ - - ! '>='
319
364
  - !ruby/object:Gem::Version
320
365
  version: '0'
321
366
  description: Engine Yard Core API Ruby Client
@@ -327,10 +372,10 @@ executables:
327
372
  extensions: []
328
373
  extra_rdoc_files: []
329
374
  files:
330
- - ".gitignore"
331
- - ".ruby-gemset"
332
- - ".ruby-version"
333
- - ".travis.yml"
375
+ - .gitignore
376
+ - .ruby-gemset
377
+ - .ruby-version
378
+ - .travis.yml
334
379
  - CHANGELOG.md
335
380
  - Gemfile
336
381
  - Guardfile
@@ -776,26 +821,27 @@ files:
776
821
  homepage: ''
777
822
  licenses:
778
823
  - MIT
779
- metadata: {}
780
824
  post_install_message:
781
825
  rdoc_options: []
782
826
  require_paths:
783
827
  - lib
784
828
  required_ruby_version: !ruby/object:Gem::Requirement
829
+ none: false
785
830
  requirements:
786
- - - ">="
831
+ - - ! '>='
787
832
  - !ruby/object:Gem::Version
788
833
  version: '0'
789
834
  required_rubygems_version: !ruby/object:Gem::Requirement
835
+ none: false
790
836
  requirements:
791
- - - ">="
837
+ - - ! '>='
792
838
  - !ruby/object:Gem::Version
793
839
  version: '0'
794
840
  requirements: []
795
841
  rubyforge_project:
796
- rubygems_version: 2.5.1
842
+ rubygems_version: 1.8.23.2
797
843
  signing_key:
798
- specification_version: 4
844
+ specification_version: 3
799
845
  summary: Client library providing real and mock functionality for accessing Engine
800
846
  Yard's Core API
801
847
  test_files:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 41ca43dab10619d7b35f84b4006899bb4f0035d0
4
- data.tar.gz: 0e6092841b676a228bd854576a3b1a28b707d2b2
5
- SHA512:
6
- metadata.gz: cee0a745d53f98771ff37485ce6415a4d39af1df891f328020ed48f7ee0ef2f1733cc0c0add2de3621571d487c6e45fb8501310bee3d6cad9ef4c15b822997ae
7
- data.tar.gz: c7a627acce7eec1877a548ce87afe18355056d1d2b4d81cc38b9ba76edf04666f6da98a1ca8d8b2f6e071a0ebcdd410df42ec2a9352efec58432aa05d93b1a4c