container_ship 0.1.4 → 0.1.6

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
  SHA256:
3
- metadata.gz: 81784b5cc4c7f154050767adc86bfa44c61da90de8c3acfe7675317e3c05e8af
4
- data.tar.gz: 568d9db35b31697a1892b9f2aaefd26f5c673a872ffda6541dd5ff64ae817a80
3
+ metadata.gz: 2cbe9992985814e2dcc555ab7ded5238a5c28b7db1a534ed7d67b10bd54f1325
4
+ data.tar.gz: adc4774f3985977582090746e7ee21bc48293dec2f1fe4aab1bfa4a5ba6f21a8
5
5
  SHA512:
6
- metadata.gz: 437ddc8b6e673f3a8a76ab4c16e371539cf99a6bfcab0a25257a2a8c1a644d723f7fdb18797612af2061f598910abc3da9cbcecac2b17777127dfa48ba79d0f1
7
- data.tar.gz: 8c4d1bd691fc124e83e4335b93e3dd16f70bf97886d46c687167c81b0ebf5c22314faae41a07bbe1f948757452f459bbcaa004c0c82c6403bf9fe18293c5a256
6
+ metadata.gz: 29cda144a2294bc6445755e7b5ddf5bb3fcf08bfe40c6ac4b6e903286189a613d4934339e90a9f242d22269fc4b89d0e8ed3796c2984f4e0689de65b9dc4fb3c
7
+ data.tar.gz: 16f8272cfaf3210317f31f210e6ef03b82925279e91e35f3e1e0d016d5cc2f249a70188a8496080f75ac27d70f454b672138af0d3f48f26a49329544672e79d2
data/.circleci/config.yml CHANGED
@@ -17,7 +17,7 @@ git statusrestore_bundle_cache: &restore_bundle_cache
17
17
  jobs:
18
18
  build:
19
19
  docker:
20
- - image: circleci/ruby:2.7.2
20
+ - image: cimg/ruby:2.7.2
21
21
  steps:
22
22
  - checkout
23
23
  - *restore_bundle_cache
@@ -29,7 +29,7 @@ jobs:
29
29
  - vendor/bundle
30
30
  rubocop:
31
31
  docker:
32
- - image: circleci/ruby:2.7.2
32
+ - image: cimg/ruby:2.7.2
33
33
  steps:
34
34
  - checkout
35
35
  - *restore_bundle_cache
@@ -38,7 +38,7 @@ jobs:
38
38
  - run: bundle exec rubocop
39
39
  rspec:
40
40
  docker:
41
- - image: circleci/ruby:2.7.2
41
+ - image: cimg/ruby:2.7.2
42
42
  steps:
43
43
  - checkout
44
44
  - *restore_bundle_cache
@@ -7,10 +7,6 @@ updates:
7
7
  time: "11:00"
8
8
  timezone: Asia/Tokyo
9
9
  open-pull-requests-limit: 20
10
- reviewers:
11
- - avexbesuke
12
- - amatotsuji
13
- - yuta-sanada0089
14
10
  allow:
15
11
  - dependency-type: direct
16
12
  - dependency-type: indirect
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- container_ship (0.1.4)
4
+ container_ship (0.1.6)
5
5
  aws-sdk-cloudwatchlogs
6
6
  aws-sdk-ecs
7
7
  thor
@@ -9,37 +9,36 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.0.3.2)
12
+ activesupport (5.2.8.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
- zeitwerk (~> 2.2, >= 2.2.2)
18
- addressable (2.8.0)
19
- public_suffix (>= 2.0.2, < 5.0)
17
+ addressable (2.8.1)
18
+ public_suffix (>= 2.0.2, < 6.0)
20
19
  ast (2.4.2)
21
- aws-eventstream (1.2.0)
22
- aws-partitions (1.560.0)
23
- aws-sdk-cloudwatchlogs (1.52.0)
24
- aws-sdk-core (~> 3, >= 3.127.0)
20
+ aws-eventstream (1.3.0)
21
+ aws-partitions (1.895.0)
22
+ aws-sdk-cloudwatchlogs (1.79.0)
23
+ aws-sdk-core (~> 3, >= 3.191.0)
25
24
  aws-sigv4 (~> 1.1)
26
- aws-sdk-core (3.127.0)
27
- aws-eventstream (~> 1, >= 1.0.2)
28
- aws-partitions (~> 1, >= 1.525.0)
29
- aws-sigv4 (~> 1.1)
30
- jmespath (~> 1.0)
31
- aws-sdk-ecs (1.96.0)
32
- aws-sdk-core (~> 3, >= 3.127.0)
25
+ aws-sdk-core (3.191.3)
26
+ aws-eventstream (~> 1, >= 1.3.0)
27
+ aws-partitions (~> 1, >= 1.651.0)
28
+ aws-sigv4 (~> 1.8)
29
+ jmespath (~> 1, >= 1.6.1)
30
+ aws-sdk-ecs (1.142.0)
31
+ aws-sdk-core (~> 3, >= 3.191.0)
33
32
  aws-sigv4 (~> 1.1)
34
- aws-sigv4 (1.4.0)
33
+ aws-sigv4 (1.8.0)
35
34
  aws-eventstream (~> 1, >= 1.0.2)
36
35
  codecov (0.6.0)
37
36
  simplecov (>= 0.15, < 0.22)
38
37
  coderay (1.1.3)
39
- concurrent-ruby (1.1.9)
38
+ concurrent-ruby (1.1.10)
40
39
  diff-lcs (1.5.0)
41
40
  docile (1.3.5)
42
- faraday (1.10.0)
41
+ faraday (1.10.2)
43
42
  faraday-em_http (~> 1.0)
44
43
  faraday-em_synchrony (~> 1.0)
45
44
  faraday-excon (~> 1.1)
@@ -54,11 +53,11 @@ GEM
54
53
  faraday-em_http (1.0.0)
55
54
  faraday-em_synchrony (1.0.0)
56
55
  faraday-excon (1.1.0)
57
- faraday-http-cache (2.2.0)
56
+ faraday-http-cache (2.4.1)
58
57
  faraday (>= 0.8)
59
58
  faraday-httpclient (1.0.1)
60
- faraday-multipart (1.0.3)
61
- multipart-post (>= 1.2, < 3)
59
+ faraday-multipart (1.0.4)
60
+ multipart-post (~> 2)
62
61
  faraday-net_http (1.0.1)
63
62
  faraday-net_http_persistent (1.2.0)
64
63
  faraday-patron (1.0.0)
@@ -91,9 +90,9 @@ GEM
91
90
  guard-rubocop (1.4.0)
92
91
  guard (~> 2.0)
93
92
  rubocop (< 2.0)
94
- i18n (1.10.0)
93
+ i18n (1.12.0)
95
94
  concurrent-ruby (~> 1.0)
96
- jmespath (1.6.0)
95
+ jmespath (1.6.2)
97
96
  listen (3.7.1)
98
97
  rb-fsevent (~> 0.10, >= 0.10.3)
99
98
  rb-inotify (~> 0.9, >= 0.9.10)
@@ -101,42 +100,42 @@ GEM
101
100
  method_source (1.0.0)
102
101
  minitest (5.15.0)
103
102
  multi_json (1.15.0)
104
- multipart-post (2.1.1)
103
+ multipart-post (2.2.3)
105
104
  nenv (0.3.0)
106
105
  notiffany (0.1.3)
107
106
  nenv (~> 0.1)
108
107
  shellany (~> 0.0)
109
- octokit (4.22.0)
110
- faraday (>= 0.9)
111
- sawyer (~> 0.8.0, >= 0.5.3)
108
+ octokit (4.25.1)
109
+ faraday (>= 1, < 3)
110
+ sawyer (~> 0.9)
112
111
  parallel (1.20.1)
113
- parser (3.1.1.0)
112
+ parser (3.1.2.1)
114
113
  ast (~> 2.4.1)
115
114
  pry (0.14.1)
116
115
  coderay (~> 1.1)
117
116
  method_source (~> 1.0)
118
- public_suffix (4.0.6)
117
+ public_suffix (4.0.7)
119
118
  rainbow (3.1.1)
120
119
  rake (13.0.6)
121
- rb-fsevent (0.11.1)
120
+ rb-fsevent (0.11.2)
122
121
  rb-inotify (0.10.1)
123
122
  ffi (~> 1.0)
124
- regexp_parser (2.2.1)
123
+ regexp_parser (2.6.0)
125
124
  retriable (3.1.2)
126
125
  rexml (3.2.5)
127
- rspec (3.11.0)
128
- rspec-core (~> 3.11.0)
129
- rspec-expectations (~> 3.11.0)
130
- rspec-mocks (~> 3.11.0)
131
- rspec-core (3.11.0)
132
- rspec-support (~> 3.11.0)
133
- rspec-expectations (3.11.0)
126
+ rspec (3.12.0)
127
+ rspec-core (~> 3.12.0)
128
+ rspec-expectations (~> 3.12.0)
129
+ rspec-mocks (~> 3.12.0)
130
+ rspec-core (3.12.0)
131
+ rspec-support (~> 3.12.0)
132
+ rspec-expectations (3.12.0)
134
133
  diff-lcs (>= 1.2.0, < 2.0)
135
- rspec-support (~> 3.11.0)
136
- rspec-mocks (3.11.0)
134
+ rspec-support (~> 3.12.0)
135
+ rspec-mocks (3.12.0)
137
136
  diff-lcs (>= 1.2.0, < 2.0)
138
- rspec-support (~> 3.11.0)
139
- rspec-support (3.11.0)
137
+ rspec-support (~> 3.12.0)
138
+ rspec-support (3.12.0)
140
139
  rubocop (1.12.1)
141
140
  parallel (~> 1.10)
142
141
  parser (>= 3.0.0.0)
@@ -150,22 +149,19 @@ GEM
150
149
  parser (>= 2.7.1.5)
151
150
  ruby-progressbar (1.11.0)
152
151
  ruby2_keywords (0.0.5)
153
- sawyer (0.8.2)
152
+ sawyer (0.9.2)
154
153
  addressable (>= 2.3.5)
155
- faraday (> 0.8, < 2.0)
154
+ faraday (>= 0.17.3, < 3)
156
155
  shellany (0.0.1)
157
- simplecov (0.21.2)
156
+ simplecov (0.18.5)
158
157
  docile (~> 1.1)
159
158
  simplecov-html (~> 0.11)
160
- simplecov_json_formatter (~> 0.1)
161
159
  simplecov-html (0.12.3)
162
- simplecov_json_formatter (0.1.4)
163
160
  thor (1.2.1)
164
161
  thread_safe (0.3.6)
165
- tzinfo (1.2.9)
162
+ tzinfo (1.2.10)
166
163
  thread_safe (~> 0.1)
167
- unicode-display_width (2.1.0)
168
- zeitwerk (2.4.2)
164
+ unicode-display_width (2.3.0)
169
165
 
170
166
  PLATFORMS
171
167
  ruby
@@ -16,10 +16,17 @@ module ContainerShip
16
16
  end
17
17
 
18
18
  desc 'exec CLUSTER_NAME SERVICE_NAME ENVIRONMENT BUILD_NUMBER', 'exec specified task'
19
- method_option 'timeout', desc: 'Timeout seconds for executing the task. Default 5 minutes.'
19
+ method_option 'timeout', default: 300, type: :numeric, desc: 'Timeout seconds for executing the task.'
20
+ method_option 'no_wait', default: false, type: :boolean,
21
+ desc: 'Exit without waiting for the task execution results. Default false.'
20
22
  def exec(cluster_name, service_name, environment, build_number)
21
- timeout = options['timeout']&.to_i || 300
22
- Command::ExecCommand.new.run(cluster_name, service_name, environment, build_number, timeout: timeout)
23
+ timeout = options['timeout']
24
+ no_wait = options['no_wait']
25
+ Command::ExecCommand.new.run(
26
+ cluster_name, service_name, environment, build_number,
27
+ timeout: timeout,
28
+ no_wait: no_wait
29
+ )
23
30
  end
24
31
 
25
32
  desc 'version', 'display gem version'
@@ -17,7 +17,7 @@ module ContainerShip
17
17
  include Modules::Ecs
18
18
  include Modules::PrintTask
19
19
 
20
- def run(cluster_name, task_name, environment, build_number, timeout: nil)
20
+ def run(cluster_name, task_name, environment, build_number, timeout: nil, no_wait: false) # rubocop:disable Metrics/ParameterLists
21
21
  task_definition = TaskDefinition.new(cluster_name, 'tasks', task_name, environment, build_number)
22
22
 
23
23
  push_image task_definition
@@ -30,6 +30,8 @@ module ContainerShip
30
30
  run_task task_definition, revision
31
31
  end
32
32
 
33
+ return if no_wait
34
+
33
35
  exit_status = print_around_task('Waiting task is completed... ') do
34
36
  wait_task task_definition, task_arn, timeout: timeout
35
37
  end
@@ -5,20 +5,21 @@ module ContainerShip
5
5
  module Modules
6
6
  module Docker
7
7
  def push_image(task_definition)
8
- puts "docker build -t \"#{task_definition.image_name}:#{task_definition.build_number}\" ."
9
8
  sh "docker build -t \"#{task_definition.image_name}:#{task_definition.build_number}\" ."
10
- puts "docker push #{task_definition.image_name}:#{task_definition.build_number}"
11
9
  sh "docker push #{task_definition.image_name}:#{task_definition.build_number}"
12
10
  end
13
11
 
14
12
  private
15
13
 
16
14
  def sh(command)
15
+ puts command
16
+
17
17
  status = nil
18
- Open3.popen3(command) do |_i, o, e, w|
19
- o.each { |line| puts line }
20
- e.each { |line| puts line }
21
- status = w.value
18
+ Open3.popen3(command) do |_stdin, stdout, stderr, wait_thr|
19
+ Thread.new(stdout) { |io| io.each { puts _1 } }
20
+ Thread.new(stderr) { |io| io.each { puts _1 } }
21
+
22
+ status = wait_thr.value
22
23
  end
23
24
  exit(status.exitstatus) unless status.success?
24
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContainerShip
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: container_ship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Ueki
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-24 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudwatchlogs
@@ -205,6 +205,7 @@ files:
205
205
  - ".github/dependabot.yml"
206
206
  - ".gitignore"
207
207
  - ".rubocop.yml"
208
+ - ".ruby-version"
208
209
  - ".travis.yml"
209
210
  - CODE_OF_CONDUCT.md
210
211
  - Gemfile
@@ -233,7 +234,7 @@ metadata:
233
234
  homepage_uri: https://github.com/seibii/container_ship
234
235
  source_code_uri: https://github.com/seibii/container_ship
235
236
  changelog_uri: https://github.com/seibii/container_ship
236
- post_install_message:
237
+ post_install_message:
237
238
  rdoc_options: []
238
239
  require_paths:
239
240
  - lib
@@ -248,8 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
249
  - !ruby/object:Gem::Version
249
250
  version: '0'
250
251
  requirements: []
251
- rubygems_version: 3.1.2
252
- signing_key:
252
+ rubygems_version: 3.1.4
253
+ signing_key:
253
254
  specification_version: 4
254
255
  summary: Yet another ECS deployment tool
255
256
  test_files: []