rake_docker 0.16.0 → 0.16.1.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -11
- data/lib/docker_output.rb +47 -0
- data/lib/rake_docker/tasks/build.rb +2 -1
- data/lib/rake_docker/tasks/push.rb +1 -1
- data/lib/rake_docker/version.rb +1 -1
- data/rake_docker.gemspec +1 -0
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5f16a02705cc04f0051afd2f517282c3cf7ee0f7b34afce35df213ad385a183
|
4
|
+
data.tar.gz: b25cb7c4d1180053584ba986b8404d41372eb10728c964d430204762fc49ea3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eab4b2c5d74f84daafb35daccf3b1e7705da7bbeb8e38a9f8a7ac23c5ed2e3ea2dab6677e2d7a9d358eecf1defd0505ae423ee68195eb96b907d67b9e81cf48
|
7
|
+
data.tar.gz: dd14371620e032183b282ca648322134023c96196cc6fc3eda372f5bff78ebdb71eee500a9ff45f44bf7fcd70c6e53a9884cc6071e77ea7d91868297ec530487
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rake_docker (0.16.
|
4
|
+
rake_docker (0.16.1.pre1)
|
5
5
|
aws-sdk (~> 2.10)
|
6
|
+
colored2 (~> 3.1)
|
6
7
|
docker-api (~> 1.34)
|
7
8
|
|
8
9
|
GEM
|
@@ -13,27 +14,28 @@ GEM
|
|
13
14
|
minitest (~> 5.1)
|
14
15
|
thread_safe (~> 0.3, >= 0.3.4)
|
15
16
|
tzinfo (~> 1.1)
|
16
|
-
aws-sdk (2.
|
17
|
-
aws-sdk-resources (= 2.
|
18
|
-
aws-sdk-core (2.
|
17
|
+
aws-sdk (2.11.93)
|
18
|
+
aws-sdk-resources (= 2.11.93)
|
19
|
+
aws-sdk-core (2.11.93)
|
19
20
|
aws-sigv4 (~> 1.0)
|
20
21
|
jmespath (~> 1.0)
|
21
|
-
aws-sdk-resources (2.
|
22
|
-
aws-sdk-core (= 2.
|
23
|
-
aws-sigv4 (1.0.
|
22
|
+
aws-sdk-resources (2.11.93)
|
23
|
+
aws-sdk-core (= 2.11.93)
|
24
|
+
aws-sigv4 (1.0.3)
|
25
|
+
colored2 (3.1.2)
|
24
26
|
diff-lcs (1.3)
|
25
27
|
docile (1.1.5)
|
26
|
-
docker-api (1.34.
|
28
|
+
docker-api (1.34.2)
|
27
29
|
excon (>= 0.47.0)
|
28
30
|
multi_json
|
29
|
-
excon (0.
|
31
|
+
excon (0.62.0)
|
30
32
|
gem-release (0.7.4)
|
31
33
|
i18n (0.8.4)
|
32
|
-
jmespath (1.
|
34
|
+
jmespath (1.4.0)
|
33
35
|
json (2.1.0)
|
34
36
|
memfs (1.0.0)
|
35
37
|
minitest (5.10.2)
|
36
|
-
multi_json (1.13.
|
38
|
+
multi_json (1.13.1)
|
37
39
|
rake (10.5.0)
|
38
40
|
rspec (3.6.0)
|
39
41
|
rspec-core (~> 3.6.0)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'colored2'
|
3
|
+
|
4
|
+
module DockerOutput
|
5
|
+
def self.parse(chunk)
|
6
|
+
chunk.each_line do |line|
|
7
|
+
yield self.parse_line(line)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.parse_line(line)
|
12
|
+
begin
|
13
|
+
json = JSON.parse(line.strip)
|
14
|
+
rescue JSON::ParserError
|
15
|
+
return line
|
16
|
+
end
|
17
|
+
|
18
|
+
# Skip progress and aux as they are covered by other status messages
|
19
|
+
return '' if json['progress'] && json['status']
|
20
|
+
return '' if json['aux']
|
21
|
+
|
22
|
+
# Return error flag as a second result
|
23
|
+
return [json['error'], true] if json['error']
|
24
|
+
|
25
|
+
return json['stream'] if json['stream']
|
26
|
+
|
27
|
+
if json['status']
|
28
|
+
if json['id']
|
29
|
+
return json['id'] + ': ' + json['status'] + "\n"
|
30
|
+
else
|
31
|
+
return json['status'] + "\n"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
return line # Nothing else matches
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.print(chunk)
|
39
|
+
self.parse(chunk) do |text, is_error|
|
40
|
+
if is_error
|
41
|
+
$stdout.print text.red + "\n"
|
42
|
+
raise text
|
43
|
+
end
|
44
|
+
$stdout.print text unless text.empty?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'docker'
|
2
2
|
require_relative '../tasklib'
|
3
|
+
require_relative '../../docker_output'
|
3
4
|
|
4
5
|
module RakeDocker
|
5
6
|
module Tasks
|
@@ -49,7 +50,7 @@ module RakeDocker
|
|
49
50
|
Docker::Image.build_from_dir(
|
50
51
|
File.join(work_directory, image_name),
|
51
52
|
options) do |chunk|
|
52
|
-
|
53
|
+
DockerOutput.print chunk
|
53
54
|
end
|
54
55
|
end
|
55
56
|
end
|
data/lib/rake_docker/version.rb
CHANGED
data/rake_docker.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_dependency 'docker-api', '~> 1.34'
|
27
27
|
spec.add_dependency 'aws-sdk', '~> 2.10'
|
28
|
+
spec.add_dependency 'colored2', '~> 3.1'
|
28
29
|
|
29
30
|
spec.add_development_dependency 'bundler', '~> 1.14'
|
30
31
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake_docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-api
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: colored2
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,6 +185,7 @@ files:
|
|
171
185
|
- config/secrets/ci/ssh.public
|
172
186
|
- config/secrets/rubygems/credentials
|
173
187
|
- go
|
188
|
+
- lib/docker_output.rb
|
174
189
|
- lib/rake_docker.rb
|
175
190
|
- lib/rake_docker/authentication.rb
|
176
191
|
- lib/rake_docker/authentication/ecr.rb
|
@@ -207,9 +222,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
222
|
version: '2.0'
|
208
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
224
|
requirements:
|
210
|
-
- - "
|
225
|
+
- - ">"
|
211
226
|
- !ruby/object:Gem::Version
|
212
|
-
version:
|
227
|
+
version: 1.3.1
|
213
228
|
requirements: []
|
214
229
|
rubyforge_project:
|
215
230
|
rubygems_version: 2.7.7
|