ecs_deployer 1.0.8 → 1.0.9

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: 67bace07e6d0c3d4d74d6653ad8c95a07e59f4d8
4
- data.tar.gz: 00b6172e90dba5cb1016a228442d3c9b6c353b20
3
+ metadata.gz: f24b082f8528d335aa2d2964e2ecdab7b524706d
4
+ data.tar.gz: 8bfc99e043a12bf461c8c1ba44e78bac504be3ae
5
5
  SHA512:
6
- metadata.gz: a00107dbc544951750210afcfaddbd70f5f61fc106df86332c1db189aa2d64127b7da7cf0233959b63ef8cdfae9c954723909334a593f61f468e0b732bb850b7
7
- data.tar.gz: e9b3c63bf33085682cf5b585738973d578f6d119fcefe632aef2426f454365e43428a183ad21b5ae5874b7fd3ab13a86c4e36a4e6d888b2b2cc76fafc23f9b5f
6
+ metadata.gz: f695b7acc3c7ed06dae88424d86a8dbc825c741ee24dd254fc42d2ba9750d01ce5269056cc525e3dbc7cb36126aa070b9bbd381984bc5033acd80a28c86aac8e
7
+ data.tar.gz: e730b9fc3f9a23742e6d0cce1797ff4eafb7943e5b66b535c32c4492515d40308959c7ec12cad214328da9bc908c9c94494b0f33e543cfd511430de28061d128
data/ecs_deployer.gemspec CHANGED
@@ -30,7 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ['lib']
32
32
 
33
- spec.add_dependency 'runtime_command', '~> 1.0'
34
33
  spec.add_dependency 'oj', '~> 3.0'
35
34
  spec.add_dependency 'thor', '~> 0.19'
36
35
  spec.add_dependency 'aws-sdk', '~> 2.9'
@@ -1,7 +1,6 @@
1
1
  require 'yaml'
2
2
  require 'oj'
3
3
  require 'aws-sdk'
4
- require 'runtime_command'
5
4
  require 'base64'
6
5
 
7
6
  module EcsDeployer
@@ -12,11 +11,10 @@ module EcsDeployer
12
11
  attr_reader :cli
13
12
  attr_accessor :timeout, :pauling_interval
14
13
 
15
- # @param [Hash] aws_options
16
- # @param [Hash] runtime_options
14
+ # @param [Logger] logger
17
15
  # @return [EcsDeployer::Client]
18
- def initialize(aws_options = {}, runtime_options = {})
19
- @runtime = RuntimeCommand::Builder.new(runtime_options)
16
+ def initialize(logger = nil, aws_options = {})
17
+ @logger = logger.nil? ? Logger.new(STDOUT) : logger
20
18
  @cli = Aws::ECS::Client.new(aws_options)
21
19
  @kms = Aws::KMS::Client.new(aws_options)
22
20
  @timeout = 600
@@ -212,7 +210,7 @@ module EcsDeployer
212
210
  raise TaskDesiredError, 'Task desired by service is 0.' if service_status[:desired_count].zero?
213
211
 
214
212
  wait_time = 0
215
- @runtime.puts 'Start deploying...'
213
+ @logger.info 'Start deploying...'
216
214
 
217
215
  loop do
218
216
  sleep(@pauling_interval)
@@ -220,25 +218,25 @@ module EcsDeployer
220
218
  result = deploy_status(cluster, service)
221
219
 
222
220
  if result[:new_running_count] == result[:current_running_count]
223
- @runtime.puts "Service update succeeded. [#{result[:new_running_count]}/#{result[:current_running_count]}]"
224
- @runtime.puts "New task definition: #{@new_task_definition_arn}"
221
+ @logger.info "Service update succeeded. [#{result[:new_running_count]}/#{result[:current_running_count]}]"
222
+ @logger.info "New task definition: #{@new_task_definition_arn}"
225
223
 
226
224
  break
227
225
 
228
226
  else
229
- @runtime.puts "Deploying... [#{result[:new_running_count]}/#{result[:current_running_count]}] (#{wait_time} seconds elapsed)"
230
- @runtime.puts "New task: #{@new_task_definition_arn}"
231
- @runtime.puts LOG_SEPARATOR
227
+ @logger.info "Deploying... [#{result[:new_running_count]}/#{result[:current_running_count]}] (#{wait_time} seconds elapsed)"
228
+ @logger.info "New task: #{@new_task_definition_arn}"
229
+ @logger.info LOG_SEPARATOR
232
230
 
233
231
  result[:task_status_logs].each do |log|
234
- @runtime.puts log
232
+ @logger.info log
235
233
  end
236
234
 
237
- @runtime.puts LOG_SEPARATOR
238
- @runtime.puts 'You can stop process with Ctrl+C. Deployment will continue.'
235
+ @logger.info LOG_SEPARATOR
236
+ @logger.info 'You can stop process with Ctrl+C. Deployment will continue.'
239
237
 
240
238
  if wait_time > @timeout
241
- @runtime.puts "New task definition: #{@new_task_definition_arn}"
239
+ @logger.info "New task definition: #{@new_task_definition_arn}"
242
240
  raise DeployTimeoutError, 'Service is being updating, but process is timed out.'
243
241
  end
244
242
  end
@@ -1,3 +1,3 @@
1
1
  module EcsDeployer
2
- VERSION = '1.0.8'.freeze
2
+ VERSION = '1.0.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs_deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - naomichi-y
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-12 00:00:00.000000000 Z
11
+ date: 2017-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: runtime_command
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: oj
29
15
  requirement: !ruby/object:Gem::Requirement