prima-twig 1.3.0 → 1.3.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/command.rb +2 -2
  3. data/lib/prima_aws_client.rb +131 -157
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94183c3b380822569fa755c6cd914da1eb15d36378d93a8faf827cf8b2a8a119
4
- data.tar.gz: 865c21d79254b4b4ad2e8034d665f74301585fd50f4fd20b019e0c6bde977183
3
+ metadata.gz: dca7d3d6359bd512ce34021d35d023a917507ae1004de5f758abe3f70f6f1c10
4
+ data.tar.gz: 14221958e4695b6ff58ac68a3c332f9b735ad2ca99093f72eaad8d1ffe4989a3
5
5
  SHA512:
6
- metadata.gz: 7604f33c35162fde446fb5e91e92451745d7eab126d09f417c36c835254949f2690c77c3f4ebbd8248c885c6c19b7786498da0cfbfe44adcb798b5641e53613f
7
- data.tar.gz: 24f093ea1a89deef5debd86afdf69b5dbb43f5f1a6aef9bc68f8a8a0b9e2e938baee20ba897116d8a2d66e5e8d7b8d60a9e1f6af267973003e7357c34d138884
6
+ metadata.gz: e2d5a682591fee449f6e62e2c7dc07bb9cb5b9fe6cf3ad265698daf5f484df20b6d77d84ca4edd279191bab807849ee7a395ed734cc4e34a55ad03d9fb1233f8
7
+ data.tar.gz: 754189d1268adc751f5d44fa20422bba0fb712e5024560234049bf417e8d59c62d7a1fd6c02caad8e740e948fd58e448aabec7112e98336637654070d3314f71
@@ -64,10 +64,10 @@ module Command
64
64
 
65
65
  # executes command and returns properly colored output
66
66
  def execute_command(cmd)
67
- output "Eseguo #{cmd}".yellow
67
+ output "Executing #{cmd}".yellow
68
68
  res = `#{cmd}`
69
69
  color = $CHILD_STATUS.exitstatus.zero? ? 'green' : 'red'
70
70
  output res.send color
71
- stop_if (color == 'red'), "Errore durante la build dell'artifact".red
71
+ stop_if (color == 'red'), 'Error'.red
72
72
  end
73
73
  end
@@ -7,7 +7,6 @@ require 'aws-sdk-ecs'
7
7
  require 'aws-sdk-elasticloadbalancingv2'
8
8
  require 'aws-sdk-s3'
9
9
  require 'colorize'
10
- #
11
10
  module PrimaAwsClient
12
11
  def s3_client
13
12
  @s3 ||= Aws::S3::Client.new
@@ -48,6 +47,7 @@ module PrimaAwsClient
48
47
  end
49
48
  stacks += resp.stacks
50
49
  break unless resp.next_token
50
+
51
51
  next_token = resp.next_token
52
52
  end
53
53
  puts '.'.yellow; STDOUT.flush
@@ -70,6 +70,7 @@ module PrimaAwsClient
70
70
  end
71
71
  stacks += resp.stacks
72
72
  break unless resp.next_token
73
+
73
74
  next_token = resp.next_token
74
75
  end
75
76
  puts '.'.yellow; STDOUT.flush
@@ -92,6 +93,7 @@ module PrimaAwsClient
92
93
  end
93
94
  exports += resp.exports
94
95
  break unless resp.next_token
96
+
95
97
  next_token = resp.next_token
96
98
  end
97
99
  puts '.'.yellow; STDOUT.flush
@@ -108,9 +110,7 @@ module PrimaAwsClient
108
110
  on_failure: 'ROLLBACK'
109
111
  }
110
112
 
111
- if role != nil then
112
- cf_args.merge!(role_arn: role)
113
- end
113
+ cf_args.merge!(role_arn: role) unless role.nil?
114
114
 
115
115
  begin
116
116
  cf_client.create_stack(cf_args)
@@ -119,7 +119,7 @@ module PrimaAwsClient
119
119
  sleep 15
120
120
  create_stack(stack_name, stack_body, parameters = [], tags = [])
121
121
  else
122
- output "La creazione dello stack #{stack_name} è stata avviata".green
122
+ output "CloudFormation stack #{stack_name} creation started".green
123
123
  end
124
124
  end
125
125
 
@@ -132,9 +132,7 @@ module PrimaAwsClient
132
132
  capabilities: ['CAPABILITY_IAM']
133
133
  }
134
134
 
135
- if role != nil then
136
- cf_args.merge!(role_arn: role)
137
- end
135
+ cf_args.merge!(role_arn: role) unless role.nil?
138
136
 
139
137
  begin
140
138
  cf_client.update_stack(cf_args)
@@ -145,7 +143,7 @@ module PrimaAwsClient
145
143
  rescue Aws::CloudFormation::Errors::ValidationError => e
146
144
  raise e
147
145
  else
148
- output "L'update dello stack #{stack_name} è stato avviato".green
146
+ output "CloudFormation stack #{stack_name} update started".green
149
147
  end
150
148
  end
151
149
 
@@ -158,9 +156,7 @@ module PrimaAwsClient
158
156
  capabilities: ['CAPABILITY_IAM']
159
157
  }
160
158
 
161
- if role != nil then
162
- cf_args.merge!(role_arn: role)
163
- end
159
+ cf_args.merge!(role_arn: role) unless role.nil?
164
160
 
165
161
  begin
166
162
  cf_client.update_stack(cf_args)
@@ -171,7 +167,7 @@ module PrimaAwsClient
171
167
  rescue Aws::CloudFormation::Errors::ValidationError => e
172
168
  raise e
173
169
  else
174
- output "L'update dello stack #{stack_name} è stato avviato".green
170
+ output "CloudFormation stack #{stack_name} update started".green
175
171
  end
176
172
  end
177
173
 
@@ -184,9 +180,7 @@ module PrimaAwsClient
184
180
  capabilities: ['CAPABILITY_IAM']
185
181
  }
186
182
 
187
- if role != nil then
188
- cf_args.merge!(role_arn: role)
189
- end
183
+ cf_args.merge!(role_arn: role) unless role.nil?
190
184
 
191
185
  begin
192
186
  cf_client.update_stack(cf_args)
@@ -197,64 +191,63 @@ module PrimaAwsClient
197
191
  rescue Aws::CloudFormation::Errors::ValidationError => e
198
192
  raise e
199
193
  else
200
- output "L'update dello stack #{stack_name} è stato avviato".green
194
+ output "CloudFormation stack #{stack_name} update started".green
201
195
  end
202
196
  end
203
197
 
204
198
  def stack_exists?(stack_name)
205
- begin
206
- cf_client.describe_stacks(stack_name: stack_name)
207
- rescue Aws::CloudFormation::Errors::Throttling => e
208
- output 'Throttling, retrying in 15 seconds'.red
209
- sleep 15
210
- stack_exists?(stack_name)
211
- rescue Aws::CloudFormation::Errors::ValidationError => e
212
- return false if e.message.include? 'does not exist'
213
- raise e
214
- else
215
- true
216
- end
199
+ cf_client.describe_stacks(stack_name: stack_name)
200
+ rescue Aws::CloudFormation::Errors::Throttling => e
201
+ output 'Throttling, retrying in 15 seconds'.red
202
+ sleep 15
203
+ stack_exists?(stack_name)
204
+ rescue Aws::CloudFormation::Errors::ValidationError => e
205
+ return false if e.message.include? 'does not exist'
206
+
207
+ raise e
208
+ else
209
+ true
217
210
  end
218
211
 
219
212
  def delete_stack(stack_name)
220
- begin
221
- cf_client.delete_stack(stack_name: stack_name)
222
- rescue Aws::CloudFormation::Errors::Throttling => e
223
- output 'Throttling, retrying in 15 seconds'.red
224
- sleep 15
225
- delete_stack(stack_name)
226
- else
227
- output "Stack #{stack_name} spenta con successo\n".green
228
- end
213
+ cf_client.delete_stack(stack_name: stack_name)
214
+ rescue Aws::CloudFormation::Errors::Throttling => e
215
+ output 'Throttling, retrying in 15 seconds'.red
216
+ sleep 15
217
+ delete_stack(stack_name)
218
+ else
219
+ output "Stack #{stack_name} shutdown succesfully\n".green
229
220
  end
230
221
 
231
- def wait_for_stack_ready(stack_name, failed_statuses = ['CREATE_FAILED', 'ROLLBACK_IN_PROGRESS', 'ROLLBACK_FAILED', 'DELETE_IN_PROGRESS', 'DELETE_FAILED', 'DELETE_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'])
222
+ def wait_for_stack_ready(stack_name, failed_statuses = %w[CREATE_FAILED ROLLBACK_IN_PROGRESS ROLLBACK_FAILED DELETE_IN_PROGRESS DELETE_FAILED DELETE_COMPLETE UPDATE_ROLLBACK_FAILED UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS])
232
223
  ready = false
233
224
  sleep_seconds = 13
234
- output "Attendo che lo stack #{stack_name} finisca di essere inizializzato...\n".yellow
235
- while !ready
225
+ output "Waiting for stack #{stack_name}...\n".yellow
226
+ until ready
236
227
  ready = true if stack_ready?(stack_name, failed_statuses)
237
228
  seconds_elapsed = 0
238
229
  loop do
239
230
  break if seconds_elapsed >= sleep_seconds
231
+
240
232
  print '.'.yellow; STDOUT.flush
241
233
  sleep 1
242
234
  seconds_elapsed += 1
243
235
  end
244
236
  end
245
- output "\nStack #{stack_name} pronto!\n".green
237
+ output "\nStack #{stack_name} ready!\n".green
246
238
  end
247
239
 
248
240
  def wait_for_stack_removal(stack_name)
249
241
  ready = false
250
242
  sleep_seconds = 13
251
243
  sleep 10
252
- output "Attendo che lo stack #{stack_name} finisca di essere cancellato...\n".yellow
253
- while !ready
244
+ output "Waiting for stack #{stack_name}...\n".yellow
245
+ until ready
254
246
  ready = true if stack_deleted?(stack_name)
255
247
  seconds_elapsed = 0
256
248
  loop do
257
249
  break if seconds_elapsed >= sleep_seconds
250
+
258
251
  print '.'.yellow; STDOUT.flush
259
252
  sleep 1
260
253
  seconds_elapsed += 1
@@ -264,55 +257,46 @@ module PrimaAwsClient
264
257
  end
265
258
 
266
259
  def get_stack_tags(name)
267
- begin
268
- resp = cf_client.describe_stacks(stack_name: name)
269
- rescue Aws::CloudFormation::Errors::Throttling => e
270
- output 'Throttling, retrying in 15 seconds'.red
271
- sleep 15
272
- get_stack_tags(name)
273
- else
274
- resp.stacks[0].tags
275
- end
260
+ resp = cf_client.describe_stacks(stack_name: name)
261
+ rescue Aws::CloudFormation::Errors::Throttling => e
262
+ output 'Throttling, retrying in 15 seconds'.red
263
+ sleep 15
264
+ get_stack_tags(name)
265
+ else
266
+ resp.stacks[0].tags
276
267
  end
277
268
 
278
269
  def get_stack_parameters(name)
279
- begin
280
- resp = cf_client.describe_stacks(stack_name: name)
281
- rescue Aws::CloudFormation::Errors::Throttling => e
282
- output 'Throttling, retrying in 15 seconds'.red
283
- sleep 15
284
- get_stack_parameters(name)
285
- else
286
- resp.stacks[0].parameters
287
- end
270
+ resp = cf_client.describe_stacks(stack_name: name)
271
+ rescue Aws::CloudFormation::Errors::Throttling => e
272
+ output 'Throttling, retrying in 15 seconds'.red
273
+ sleep 15
274
+ get_stack_parameters(name)
275
+ else
276
+ resp.stacks[0].parameters
288
277
  end
289
278
 
290
279
  def get_stack_outputs(name)
291
- begin
292
- resp = cf_client.describe_stacks(stack_name: name)
293
- rescue Aws::CloudFormation::Errors::Throttling => e
294
- output 'Throttling, retrying in 15 seconds'.red
295
- sleep 15
296
- get_stack_outputs(name)
297
- else
298
- resp.stacks[0].outputs
299
- end
280
+ resp = cf_client.describe_stacks(stack_name: name)
281
+ rescue Aws::CloudFormation::Errors::Throttling => e
282
+ output 'Throttling, retrying in 15 seconds'.red
283
+ sleep 15
284
+ get_stack_outputs(name)
285
+ else
286
+ resp.stacks[0].outputs
300
287
  end
301
288
 
302
289
  def get_stack_template(name)
303
- begin
304
- resp = cf_client.get_template(stack_name: name)
305
- rescue Aws::CloudFormation::Errors::Throttling => e
306
- output 'Throttling, retrying in 15 seconds'.red
307
- sleep 15
308
- get_stack_template(name)
309
- else
310
- resp.template_body
311
- end
312
-
290
+ resp = cf_client.get_template(stack_name: name)
291
+ rescue Aws::CloudFormation::Errors::Throttling => e
292
+ output 'Throttling, retrying in 15 seconds'.red
293
+ sleep 15
294
+ get_stack_template(name)
295
+ else
296
+ resp.template_body
313
297
  end
314
298
 
315
- def stack_ready?(stack_name, failed_statuses = ['CREATE_FAILED', 'ROLLBACK_IN_PROGRESS', 'ROLLBACK_FAILED', 'DELETE_IN_PROGRESS', 'DELETE_FAILED', 'DELETE_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'])
299
+ def stack_ready?(stack_name, failed_statuses = %w[CREATE_FAILED ROLLBACK_IN_PROGRESS ROLLBACK_FAILED DELETE_IN_PROGRESS DELETE_FAILED DELETE_COMPLETE UPDATE_ROLLBACK_FAILED UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS])
316
300
  begin
317
301
  resp = cf_client.describe_stacks(
318
302
  stack_name: stack_name
@@ -323,10 +307,11 @@ module PrimaAwsClient
323
307
  return false
324
308
  end
325
309
  raise "The stack #{stack_name} errored out" if failed_statuses.include? stack_status
326
- ['CREATE_COMPLETE', 'UPDATE_COMPLETE', 'UPDATE_ROLLBACK_COMPLETE', 'ROLLBACK_COMPLETE'].include? stack_status
310
+
311
+ %w[CREATE_COMPLETE UPDATE_COMPLETE UPDATE_ROLLBACK_COMPLETE ROLLBACK_COMPLETE].include? stack_status
327
312
  end
328
313
 
329
- def stack_deleted?(stack_name, failed_statuses = ['ROLLBACK_IN_PROGRESS', 'ROLLBACK_FAILED', 'DELETE_FAILED', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'])
314
+ def stack_deleted?(stack_name, failed_statuses = %w[ROLLBACK_IN_PROGRESS ROLLBACK_FAILED DELETE_FAILED UPDATE_ROLLBACK_FAILED UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS])
330
315
  begin
331
316
  resp = cf_client.describe_stacks(
332
317
  stack_name: stack_name
@@ -340,6 +325,7 @@ module PrimaAwsClient
340
325
  return true
341
326
  end
342
327
  raise "The stack #{stack_name} errored out" if failed_statuses.include? stack_status
328
+
343
329
  ['DELETE_COMPLETE'].include? stack_status
344
330
  end
345
331
 
@@ -352,38 +338,39 @@ module PrimaAwsClient
352
338
  !resp.contents.empty?
353
339
  end
354
340
 
355
- def upload_artifact(source_path, destination_path, bucket_name_override=nil)
356
- output "Upload dell'artifact in corso (#{(File.size(source_path).to_f / 2**20).round(2)} MiB)\n".yellow
341
+ def upload_artifact(source_path, destination_path, bucket_name_override = nil)
342
+ output "Uploading artifact (#{(File.size(source_path).to_f / 2**20).round(2)} MiB)\n".yellow
357
343
  s3 = Aws::S3::Resource.new
358
- s3_bucket = if !bucket_name_override.nil? then bucket_name_override else @s3_bucket end
344
+ s3_bucket = !bucket_name_override.nil? ? bucket_name_override : @s3_bucket
359
345
  puts s3_bucket
360
346
  obj = s3.bucket(s3_bucket).object(destination_path)
361
347
  obj.upload_file(source_path)
362
348
 
363
- output "#{s3_bucket}/#{destination_path} uploadato con successo!\n".green
349
+ output "#{s3_bucket}/#{destination_path} upload success!\n".green
364
350
  end
365
351
 
366
352
  def wait_for_artifact(bucket, path)
367
353
  ready = artifact_exists?(bucket, path)
368
354
  sleep_seconds = 13
369
- output "Attendo che sia pronto l'artefatto #{path}...\n".yellow
355
+ output "Wating that artifact #{path} becomes ready...\n".yellow
370
356
  retries = 0
371
- while !ready
357
+ until ready
372
358
  ready = true if artifact_exists?(bucket, path)
373
359
  seconds_elapsed = 0
374
360
  loop do
375
361
  break if seconds_elapsed >= sleep_seconds
362
+
376
363
  print '.'.yellow; STDOUT.flush
377
364
  sleep 1
378
365
  seconds_elapsed += 1
379
366
  end
380
367
  retries += 1
381
368
  if retries > 150
382
- output "\n Timeout raggiunto aspettando #{path}\n".red
369
+ output "\n Artifact #{path} timed out\n".red
383
370
  exit
384
371
  end
385
372
  end
386
- output "\nArtefatto #{path} creato!\n".green
373
+ output "\nArtifact #{path} created!\n".green
387
374
  end
388
375
 
389
376
  def list_import_stacks(export_name)
@@ -391,7 +378,7 @@ module PrimaAwsClient
391
378
  next_token = ''
392
379
  loop do
393
380
  print '.'.yellow; STDOUT.flush
394
- options = next_token != '' ? { export_name: export_name, next_token: next_token } : {export_name: export_name}
381
+ options = next_token != '' ? { export_name: export_name, next_token: next_token } : { export_name: export_name }
395
382
  begin
396
383
  resp = cf_client.list_imports(options)
397
384
  rescue Aws::CloudFormation::Errors::Throttling => e
@@ -401,94 +388,81 @@ module PrimaAwsClient
401
388
  end
402
389
  stacks += resp.imports
403
390
  break unless resp.next_token
391
+
404
392
  next_token = resp.next_token
405
393
  end
406
394
  stacks
407
395
  end
408
396
 
409
397
  def describe_stack_resource(cluster_stack_name, logical_resource_id)
410
- begin
411
- resp = cf_client.describe_stack_resource({stack_name: cluster_stack_name, logical_resource_id: logical_resource_id})
412
- rescue Aws::CloudFormation::Errors::Throttling => e
413
- output 'Throttling, retrying in 15 seconds'.red
414
- sleep 15
415
- resp = describe_stack_resource(cluster_stack_name, logical_resource_id)
416
- end
398
+ resp = cf_client.describe_stack_resource({ stack_name: cluster_stack_name, logical_resource_id: logical_resource_id })
399
+ rescue Aws::CloudFormation::Errors::Throttling => e
400
+ output 'Throttling, retrying in 15 seconds'.red
401
+ sleep 15
402
+ resp = describe_stack_resource(cluster_stack_name, logical_resource_id)
417
403
  end
418
404
 
419
405
  def describe_instances(instance_ids)
420
- begin
421
- resp = ec2_client.describe_instances({instance_ids: instance_ids})
422
- rescue Aws::CloudFormation::Errors::Throttling => e
423
- output 'Throttling, retrying in 15 seconds'.red
424
- sleep 15
425
- resp = describe_instances(instance_ids)
426
- end
406
+ resp = ec2_client.describe_instances({ instance_ids: instance_ids })
407
+ rescue Aws::CloudFormation::Errors::Throttling => e
408
+ output 'Throttling, retrying in 15 seconds'.red
409
+ sleep 15
410
+ resp = describe_instances(instance_ids)
427
411
  end
428
412
 
429
413
  def describe_auto_scaling_groups(auto_scaling_group_names, max_records)
430
- begin
431
- resp = asg_client.describe_auto_scaling_groups({
432
- auto_scaling_group_names: auto_scaling_group_names,
433
- max_records: max_records
434
- })
435
- rescue Aws::CloudFormation::Errors::Throttling => e
436
- output 'Throttling, retrying in 15 seconds'.red
437
- sleep 15
438
- resp = describe_auto_scaling_groups(auto_scaling_group_names, max_records)
439
- end
414
+ resp = asg_client.describe_auto_scaling_groups({
415
+ auto_scaling_group_names: auto_scaling_group_names,
416
+ max_records: max_records
417
+ })
418
+ rescue Aws::CloudFormation::Errors::Throttling => e
419
+ output 'Throttling, retrying in 15 seconds'.red
420
+ sleep 15
421
+ resp = describe_auto_scaling_groups(auto_scaling_group_names, max_records)
440
422
  end
441
423
 
442
424
  def describe_load_balancers(load_balancer_arns)
443
- begin
444
- resp = alb_client.describe_load_balancers({load_balancer_arns: load_balancer_arns})
445
- rescue Aws::ElasticLoadBalancingV2::Errors::Throttling => e
446
- output 'Throttling, retrying in 15 seconds'.red
447
- sleep 15
448
- resp = describe_load_balancers(load_balancer_arns)
449
- end
425
+ resp = alb_client.describe_load_balancers({ load_balancer_arns: load_balancer_arns })
426
+ rescue Aws::ElasticLoadBalancingV2::Errors::Throttling => e
427
+ output 'Throttling, retrying in 15 seconds'.red
428
+ sleep 15
429
+ resp = describe_load_balancers(load_balancer_arns)
450
430
  end
451
431
 
452
432
  def update_ecs_service(cluster, service, deployment_configuration)
453
- begin
454
- resp = ecs_client.update_service(
455
- cluster: cluster,
456
- service: service,
457
- deployment_configuration: deployment_configuration
458
- )
459
- rescue Aws::CloudFormation::Errors::Throttling => e
460
- output 'Throttling, retrying in 15 seconds'.red
461
- sleep 15
462
- resp = update_ecs_service(cluster, service, deployment_configuration)
463
- end
433
+ resp = ecs_client.update_service(
434
+ cluster: cluster,
435
+ service: service,
436
+ deployment_configuration: deployment_configuration
437
+ )
438
+ rescue Aws::CloudFormation::Errors::Throttling => e
439
+ output 'Throttling, retrying in 15 seconds'.red
440
+ sleep 15
441
+ resp = update_ecs_service(cluster, service, deployment_configuration)
464
442
  end
465
443
 
466
444
  def describe_ecs_tasks(cluster, tasks)
467
- begin
468
- resp = ecs_client.describe_tasks({
469
- cluster: cluster,
470
- tasks: tasks
471
- })
472
- rescue Aws::CloudFormation::Errors::Throttling => e
473
- output 'Throttling, retrying in 15 seconds'.red
474
- sleep 15
475
- resp = describe_ecs_tasks(cluster, tasks)
476
- end
445
+ resp = ecs_client.describe_tasks({
446
+ cluster: cluster,
447
+ tasks: tasks
448
+ })
449
+ rescue Aws::CloudFormation::Errors::Throttling => e
450
+ output 'Throttling, retrying in 15 seconds'.red
451
+ sleep 15
452
+ resp = describe_ecs_tasks(cluster, tasks)
477
453
  end
478
454
 
479
455
  def run_ecs_task(cluster, task_definition, overrides, count)
480
- begin
481
- resp = ecs_client.run_task({
482
- cluster: cluster,
483
- task_definition: task_definition,
484
- overrides: overrides,
485
- count: count
486
- })
487
- rescue Aws::CloudFormation::Errors::Throttling => e
488
- output 'Throttling, retrying in 15 seconds'.red
489
- sleep 15
490
- resp = run_ecs_task(cluster, task_definition, overrides, count)
491
- end
456
+ resp = ecs_client.run_task({
457
+ cluster: cluster,
458
+ task_definition: task_definition,
459
+ overrides: overrides,
460
+ count: count
461
+ })
462
+ rescue Aws::CloudFormation::Errors::Throttling => e
463
+ output 'Throttling, retrying in 15 seconds'.red
464
+ sleep 15
465
+ resp = run_ecs_task(cluster, task_definition, overrides, count)
492
466
  end
493
467
 
494
468
  def get_autoscaling_capacity(asg_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prima-twig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Giachino
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-11-16 00:00:00.000000000 Z
17
+ date: 2020-11-18 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aws-sdk-autoscaling