hako 1.5.1 → 1.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04d2766afefc3cd5487ac4842a6f8f212ae48485
4
- data.tar.gz: abc972a188d6c19752a0c683c4497888b732d104
3
+ metadata.gz: 1407a0536a7ceb26b385676d75b54acbc88f01c6
4
+ data.tar.gz: 5a66b42284d1e620a07217f9f5d6d6cd3313f788
5
5
  SHA512:
6
- metadata.gz: 80a34e0bca148d384d6e96fb64e2158cce50b92fb70fbfe445088e644221075963afb98d6774de009c760cd74b0f8cce6fa514fa6cd3408ef622c1b3ca08b07d
7
- data.tar.gz: a92f906c25ddd0cf48f8a06339e749e6354f4c34b418ec640638788fe637e541f929036200a7f45f7d484be6ddefd9c85f5f9259a2b34d9f29457ab285598b6a
6
+ metadata.gz: f3d0e37907893a6b21ce3440936d54c7737e3ffd2949253681a86013c338a453811ec12e467e4d833f7b34b068cc0de9f1d67d18ff56d0e15db2e4981ba4b43e
7
+ data.tar.gz: a319f40f7638445fe2f8e0b95857b9262317db80a6dcc4fa9e7bdcba1b799a1075566b78d539fe1de32c41fc68c666afb966e0874c169732f675108d87474f28
@@ -1,3 +1,7 @@
1
+ # 1.5.2 (2017-06-08)
2
+ ## Bug fixes
3
+ - Retry RegisterTaskDefinition when "too many concurrent attempts" error occurs
4
+
1
5
  # 1.5.1 (2017-06-06)
2
6
  ## Bug fixes
3
7
  - Fix error in dry-run mode when ALB isn't created yet
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Kohei Suzuki
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = 'Deploy Docker container'
14
14
  spec.description = 'Deploy Docker container'
15
15
  spec.homepage = 'https://github.com/eagletmt/hako'
16
+ spec.license = 'MIT'
16
17
 
17
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
19
  spec.bindir = 'exe'
@@ -435,19 +435,33 @@ module Hako
435
435
  # @param [Array<Hash>] definitions
436
436
  # @return [Array<Boolean, Aws::ECS::Types::TaskDefinition]
437
437
  def register_task_definition_for_oneshot(definitions)
438
- family = "#{@app_id}-oneshot"
439
- current_task_definition = describe_task_definition(family)
440
- if task_definition_changed?(definitions, current_task_definition)
441
- new_task_definition = ecs_client.register_task_definition(
442
- family: family,
443
- task_role_arn: @task_role_arn,
444
- container_definitions: definitions,
445
- volumes: volumes_definition,
446
- ).task_definition
447
- [true, new_task_definition]
448
- else
449
- [false, current_task_definition]
438
+ 10.times do |i|
439
+ begin
440
+ family = "#{@app_id}-oneshot"
441
+ current_task_definition = describe_task_definition(family)
442
+ if task_definition_changed?(definitions, current_task_definition)
443
+ new_task_definition = ecs_client.register_task_definition(
444
+ family: family,
445
+ task_role_arn: @task_role_arn,
446
+ container_definitions: definitions,
447
+ volumes: volumes_definition,
448
+ ).task_definition
449
+ return [true, new_task_definition]
450
+ else
451
+ return [false, current_task_definition]
452
+ end
453
+ rescue Aws::ECS::Errors::ClientException => e
454
+ if e.message.include?('Too many concurrent attempts to create a new revision of the specified family')
455
+ Hako.logger.error(e.message)
456
+ interval = 2**i + rand(0.0..10.0)
457
+ Hako.logger.error("Retrying register_task_definition_for_oneshot after #{interval} seconds")
458
+ sleep(interval)
459
+ else
460
+ raise e
461
+ end
462
+ end
450
463
  end
464
+ raise Error.new('Unable to register task definition for oneshot due to too many client errors')
451
465
  end
452
466
 
453
467
  # @return [Hash]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hako
4
- VERSION = '1.5.1'
4
+ VERSION = '1.5.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hako
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -138,6 +138,7 @@ files:
138
138
  - ".yardopts"
139
139
  - CHANGELOG.md
140
140
  - Gemfile
141
+ - LICENSE.txt
141
142
  - README.md
142
143
  - Rakefile
143
144
  - bin/console
@@ -195,7 +196,8 @@ files:
195
196
  - lib/hako/version.rb
196
197
  - lib/hako/yaml_loader.rb
197
198
  homepage: https://github.com/eagletmt/hako
198
- licenses: []
199
+ licenses:
200
+ - MIT
199
201
  metadata: {}
200
202
  post_install_message:
201
203
  rdoc_options: []