ecs_deployer 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dbede2e477b7494c7ce86d997b1bc63760be467
4
- data.tar.gz: 09ab13c573ae1fc4efb73daef2be2e85fb356fe7
3
+ metadata.gz: 99a7cf49a1d03e03b5123ca450ec7bd47556727c
4
+ data.tar.gz: f5b5034613058e2d751cd02ddb87f74642dfe3d1
5
5
  SHA512:
6
- metadata.gz: d1ae2cc0e11b1ee2909a771d240bb27b8e3b31ac49beeb8860738709df4b319a600413910c6bd87acdf81c88e6249db5c771cc217238ef6b26727be80e446383
7
- data.tar.gz: 6c2fb378ca31391072450169588915f8ad5fe10c936db13a633b936c9395d763940412abe15ae7a88a120c2501baed234bb4d3a7cea0e01b351d2bb3553375e5
6
+ metadata.gz: a242f366905b234991bedbd4bb9c57158ed151043fa9a82bde5bbc1ec2b26c4e0d1928b0a04af621447200f2d4bc8a8ea715b8de74f767ba10dfbb98467bca5c
7
+ data.tar.gz: ae03c016bbf5f3079120703551867cb19be4a8a27409f5dc25ecacb58b5d479725f2f51cd5b9fcd44a5b211405f5060b1e74c45c52f88a42d6c2e221751f7bd9
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
4
  /_yardoc/
5
- /coverage/
6
5
  /doc/
7
6
  /pkg/
8
7
  /spec/reports/
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # EcsDeployer
2
2
 
3
- [![CircleCI](https://circleci.com/gh/naomichi-y/ecs_deployer/tree/master.svg?style=svg)](https://circleci.com/gh/naomichi-y/ecs_deployer/tree/master)
4
3
  [![Gem Version](https://badge.fury.io/rb/ecs_deployer.svg)](https://badge.fury.io/rb/ecs_deployer)
4
+ [![Test Coverage](https://codeclimate.com/github/naomichi-y/ecs_deployer/badges/coverage.svg)](https://codeclimate.com/github/naomichi-y/ecs_deployer/coverage)
5
+ [![Code Climate](https://codeclimate.com/github/naomichi-y/ecs_deployer/badges/gpa.svg)](https://codeclimate.com/github/naomichi-y/ecs_deployer)
6
+ [![CircleCI](https://circleci.com/gh/naomichi-y/ecs_deployer/tree/master.svg?style=svg)](https://circleci.com/gh/naomichi-y/ecs_deployer/tree/master)
5
7
 
6
8
  ## Description
7
9
 
data/circle.yml ADDED
@@ -0,0 +1,4 @@
1
+ test:
2
+ override:
3
+ - bundle exec rspec
4
+ - bundle exec codeclimate-test-reporter tmp/coverage/.resultset.json
data/ecs_deployer.gemspec CHANGED
@@ -40,4 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'json_spec'
41
41
  spec.add_development_dependency 'rubocop'
42
42
  spec.add_development_dependency 'simplecov'
43
+ spec.add_development_dependency 'codeclimate-test-reporter'
43
44
  end
@@ -12,6 +12,8 @@ module EcsDeployer
12
12
  aws_options[:region] = options[:region] if options[:region]
13
13
 
14
14
  @deployer = EcsDeployer::Client.new(aws_options)
15
+
16
+ nil
15
17
  end
16
18
 
17
19
  def invoke_command(command, *args)
@@ -15,9 +15,10 @@ module EcsDeployer
15
15
  # @param [Hash] aws_options
16
16
  # @option aws_options [String] :profile
17
17
  # @option aws_options [String] :region
18
+ # @param [RuntimeCommand::Builder] runtime
18
19
  # @return [EcsDeployer::Client]
19
- def initialize(aws_options = {})
20
- @command = RuntimeCommand::Builder.new
20
+ def initialize(aws_options = {}, runtime = nil)
21
+ @runtime = runtime || RuntimeCommand::Builder.new
21
22
  @cli = Aws::ECS::Client.new(aws_options)
22
23
  @kms = Aws::KMS::Client.new(aws_options)
23
24
  @timeout = 600
@@ -189,7 +190,7 @@ module EcsDeployer
189
190
  raise TaskDesiredError, 'Task desired by service is 0.' if service_status[:desired_count].zero?
190
191
 
191
192
  wait_time = 0
192
- @command.puts 'Start deploing...'
193
+ @runtime.puts 'Start deploing...'
193
194
 
194
195
  loop do
195
196
  sleep(@pauling_interval)
@@ -197,21 +198,21 @@ module EcsDeployer
197
198
  result = deploy_status(cluster, service)
198
199
 
199
200
  if result[:new_running_count] == result[:current_running_count]
200
- @command.puts "Service update succeeded. [#{result[:new_running_count]}/#{result[:current_running_count]}]"
201
- @command.puts "New task definition: #{@new_task_definition_arn}"
201
+ @runtime.puts "Service update succeeded. [#{result[:new_running_count]}/#{result[:current_running_count]}]"
202
+ @runtime.puts "New task definition: #{@new_task_definition_arn}"
202
203
 
203
204
  break
204
205
 
205
206
  else
206
- @command.puts "Deploying... [#{result[:new_running_count]}/#{result[:current_running_count]}] (#{wait_time} seconds elapsed)"
207
- @command.puts "New task: #{@new_task_definition_arn}"
208
- @command.puts LOG_SEPARATOR
209
- @command.puts result[:task_status_logs]
210
- @command.puts LOG_SEPARATOR
211
- @command.puts 'You can stop process with Ctrl+C. Deployment will continue.'
207
+ @runtime.puts "Deploying... [#{result[:new_running_count]}/#{result[:current_running_count]}] (#{wait_time} seconds elapsed)"
208
+ @runtime.puts "New task: #{@new_task_definition_arn}"
209
+ @runtime.puts LOG_SEPARATOR
210
+ @runtime.puts result[:task_status_logs]
211
+ @runtime.puts LOG_SEPARATOR
212
+ @runtime.puts 'You can stop process with Ctrl+C. Deployment will continue.'
212
213
 
213
214
  if wait_time > @timeout
214
- @command.puts "New task definition: #{@new_task_definition_arn}"
215
+ @runtime.puts "New task definition: #{@new_task_definition_arn}"
215
216
  raise DeployTimeoutError, 'Service is being updating, but process is timed out.'
216
217
  end
217
218
  end
@@ -1,3 +1,3 @@
1
1
  module EcsDeployer
2
- VERSION = '0.1.13'.freeze
2
+ VERSION = '0.1.14'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs_deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
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-03-17 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runtime_command
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: codeclimate-test-reporter
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  description: This package provides the service deployment function of ECS.
168
182
  email:
169
183
  - n.yamakita@gmail.com
@@ -180,6 +194,7 @@ files:
180
194
  - Rakefile
181
195
  - bin/console
182
196
  - bin/setup
197
+ - circle.yml
183
198
  - ecs_deployer.gemspec
184
199
  - example/sample.rb
185
200
  - exe/ecs_deployer