all_images 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/all_images.gemspec +4 -2
- data/lib/all_images/app.rb +19 -10
- data/lib/all_images/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82689ac58a78b67b9df7e34612695f8202e117eca7398d9bcddaf4026cbedf32
|
4
|
+
data.tar.gz: 24eedd1e870051e86b25662f4340af33e9ca21cc50ad2fb401455c5a716eed8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1221949f5c98a131a5763ab23ddcb094a88d3954c99c1d989a23446fc1efd4f23c8a0199a3f5892f04962a3e8247c97ecc8e628c0c252b2b3f203ee817a4bd2
|
7
|
+
data.tar.gz: c565da18add211c6c8005c606f44cd07a059e8a18166d69b00b712ba8203d8536b22d87e1557108c4163e3acbe7abb256ca6c657957e3442ff82c8111b53b562
|
data/Rakefile
CHANGED
data/all_images.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: all_images 0.
|
2
|
+
# stub: all_images 0.3.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "all_images".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.3.0"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
31
31
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
32
32
|
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
33
|
+
s.add_development_dependency(%q<debug>.freeze, [">= 0"])
|
33
34
|
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0"])
|
34
35
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, [">= 0"])
|
35
36
|
else
|
@@ -37,6 +38,7 @@ Gem::Specification.new do |s|
|
|
37
38
|
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
38
39
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
39
40
|
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
41
|
+
s.add_dependency(%q<debug>.freeze, [">= 0"])
|
40
42
|
s.add_dependency(%q<tins>.freeze, ["~> 1.0"])
|
41
43
|
s.add_dependency(%q<term-ansicolor>.freeze, [">= 0"])
|
42
44
|
end
|
data/lib/all_images/app.rb
CHANGED
@@ -33,8 +33,7 @@ class AllImages::App
|
|
33
33
|
when 'debug_selected'
|
34
34
|
image == @selected and result |= run_image(image, script, interactive: true)
|
35
35
|
end
|
36
|
-
result
|
37
|
-
if @config['fail_fast'] && result
|
36
|
+
if @config['fail_fast'] && result != 0
|
38
37
|
return 1
|
39
38
|
end
|
40
39
|
end
|
@@ -46,14 +45,19 @@ class AllImages::App
|
|
46
45
|
|
47
46
|
def run_image(image, script, interactive: false)
|
48
47
|
dockerfile = @config.fetch('dockerfile').to_s
|
49
|
-
tag = provide_image image, dockerfile
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
tag = provide_image image, dockerfile, script
|
49
|
+
if interactive
|
50
|
+
puts "You can run /script interactively now."
|
51
|
+
sh "docker run --name all_images -it -v `pwd`:/work '#{tag}' sh"
|
53
52
|
return 0
|
54
53
|
else
|
55
|
-
|
56
|
-
|
54
|
+
if sh "docker run --name all_images -v `pwd`:/work '#{tag}' sh -c /script"
|
55
|
+
puts green('SUCCESS')
|
56
|
+
return 0
|
57
|
+
else
|
58
|
+
puts red('FAILURE')
|
59
|
+
return 1
|
60
|
+
end
|
57
61
|
end
|
58
62
|
ensure
|
59
63
|
sh 'docker rm -f all_images >/dev/null'
|
@@ -92,20 +96,25 @@ class AllImages::App
|
|
92
96
|
AllImages::Config.load(config_filename)
|
93
97
|
end
|
94
98
|
|
95
|
-
def provide_image(image, dockerfile)
|
99
|
+
def provide_image(image, dockerfile, script)
|
96
100
|
prefix = @config.fetch('prefix', File.basename(Dir.pwd))
|
97
101
|
tag = "#{prefix}/all_images/#{image}"
|
98
102
|
sh "docker pull '#{image}'"
|
99
103
|
build_dir = File.join(Dir.tmpdir, 'build')
|
100
104
|
mkdir_p build_dir
|
101
105
|
cd build_dir do
|
102
|
-
File.open('
|
106
|
+
File.open('script', ?w) do |s|
|
107
|
+
s.print script
|
108
|
+
end
|
109
|
+
File.open('Dockerfile', ?w) do |t|
|
103
110
|
t.puts <<~end
|
104
111
|
FROM #{image}
|
105
112
|
|
106
113
|
WORKDIR /work
|
107
114
|
|
108
115
|
#{dockerfile}
|
116
|
+
|
117
|
+
COPY --chmod=755 script /script
|
109
118
|
end
|
110
119
|
end
|
111
120
|
sh "docker build --pull -t '#{tag}' ."
|
data/lib/all_images/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: all_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: debug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: tins
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|