all_images 0.2.1 → 0.2.3

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: caf66d8b951b234a0c223aae8e0a34ec57680c59c4e336d72128ae94cf81427f
4
- data.tar.gz: d57279b471c59a479e472adaf339e1549b6f3caadab8ade6277b8649733158dd
3
+ metadata.gz: 2a60ee1556ea6be5325f6674cab02b047bf0d0e6e5b97e6b2b8419a66a99888e
4
+ data.tar.gz: 5036c7fd5a7f031c375dbed835b7f9e79bb6c47a1266e7c0589aae00023446ec
5
5
  SHA512:
6
- metadata.gz: 99d4b2ad103e5b6be87ebaaa489479042ac2a8f05cec5477eb8eb10f4ff6a2d4b17b70a98b5d43dcc624b995921b021263a3e649d7d629a676329b662942b122
7
- data.tar.gz: ed8c42dbe74ab966ded63e764a67abc94447d12e18f142e54425191b01ca6154bce45b6c622bfc51ca255cfeb7cbe312c4ced8646e1f37d00f864b78e2e9003d
6
+ metadata.gz: c856e7d9c7074006c3fde6f6625a32464be5a354a7227f1ce8e59b3b67a27da3b5f4ab66f52fb304f4a2a0916e2ce7b2ffbd5bc1a5550585e12c8ec14b3cf511
7
+ data.tar.gz: 473967fcfe87487be735cba810857127e55ed1249e38269e9e40406631fa38ff2d022545470f0c15b0ea9523ab1051ca485a2cf0510fd702091387776f3e72a6
data/Rakefile CHANGED
@@ -21,7 +21,6 @@ GemHadar do
21
21
  development_dependency 'rake'
22
22
  development_dependency 'simplecov'
23
23
  development_dependency 'rspec'
24
- development_dependency 'debug'
25
24
  licenses << 'MIT'
26
25
  executables << 'all_images'
27
26
  end
data/all_images.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: all_images 0.2.1 ruby lib
2
+ # stub: all_images 0.2.3 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "all_images".freeze
6
- s.version = "0.2.1"
6
+ s.version = "0.2.3"
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]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2022-11-17"
11
+ s.date = "2023-06-01"
12
12
  s.description = "A script that runs a script in all of the configured docker images".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.executables = ["all_images".freeze]
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.homepage = "http://github.com/flori/all_images".freeze
18
18
  s.licenses = ["MIT".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "AllImages -- Runs a script in all of the docker images".freeze, "--main".freeze, "README.md".freeze]
20
- s.rubygems_version = "3.3.17".freeze
20
+ s.rubygems_version = "3.3.26".freeze
21
21
  s.summary = "Runs a script in all of the docker images".freeze
22
22
  s.test_files = ["spec/spec_helper.rb".freeze]
23
23
 
@@ -30,7 +30,6 @@ 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"])
34
33
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0"])
35
34
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, [">= 0"])
36
35
  else
@@ -38,7 +37,6 @@ Gem::Specification.new do |s|
38
37
  s.add_dependency(%q<rake>.freeze, [">= 0"])
39
38
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
40
39
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
41
- s.add_dependency(%q<debug>.freeze, [">= 0"])
42
40
  s.add_dependency(%q<tins>.freeze, ["~> 1.0"])
43
41
  s.add_dependency(%q<term-ansicolor>.freeze, [">= 0"])
44
42
  end
@@ -9,29 +9,34 @@ class AllImages::App
9
9
  alias sh system
10
10
 
11
11
  def initialize(args)
12
- @args = args.dup
13
- @command = pick_command
12
+ @args = args.dup
13
+ @command = pick_command
14
+ @commands = %w[ ls help run debug run_all ].sort
14
15
  end
15
16
 
16
17
  def run
17
- result = 0
18
- @config = load_config or return 23
18
+ @config = load_config or return 23
19
19
 
20
+ result = 0
20
21
  case @command
21
22
  when 'ls'
22
23
  puts Array(@config['images']).map(&:first)
23
24
  when 'help'
24
- commands = %w[ ls help run debug run_all ].sort
25
- puts "Usage: #{File.basename($0)} #{commands * ?|} IMAGE"
25
+ puts "Usage: #{File.basename($0)} #{@commands * ?|} IMAGE"
26
26
  else
27
27
  Array(@config['images']).each do |image, script|
28
28
  case @command
29
29
  when 'run_all'
30
- run_image(image, script)
30
+ result |= run_image(image, script)
31
31
  when 'run_selected'
32
- image == @selected and run_image(image, script)
32
+ image == @selected and result |= run_image(image, script)
33
33
  when 'debug_selected'
34
- image == @selected and run_image(image, script, interactive: true)
34
+ image == @selected and result |= run_image(image, script, interactive: true)
35
+ end
36
+ if @config['fail_fast']
37
+ return 1
38
+ else
39
+ result |= 1
35
40
  end
36
41
  end
37
42
  end
@@ -46,13 +51,10 @@ class AllImages::App
46
51
  it = interactive ? ' -it ' : ' '
47
52
  if sh "docker run --name all_images#{it}-v `pwd`:/work '#{tag}' sh -c '#{script}'"
48
53
  puts green('SUCCESS')
54
+ return 0
49
55
  else
50
56
  puts red('FAILURE')
51
- if @config['fail_fast']
52
- return 1
53
- else
54
- result |= 1
55
- end
57
+ return 1
56
58
  end
57
59
  ensure
58
60
  sh 'docker rm -f all_images >/dev/null'
@@ -70,7 +72,7 @@ class AllImages::App
70
72
  when 'debug'
71
73
  @selected = @args.shift or fail "Usage: #{File.basename($0)} #{command} IMAGE"
72
74
  'debug_selected'
73
- when 'help'
75
+ else
74
76
  'help'
75
77
  end
76
78
  end
@@ -19,11 +19,11 @@ module AllImages::Config
19
19
  rake test
20
20
 
21
21
  images:
22
+ ruby:3.2-alpine: *script
22
23
  ruby:3.1-alpine: *script
23
24
  ruby:3.0-alpine: *script
24
25
  ruby:2.7-alpine: *script
25
26
  ruby:2.6-alpine: *script
26
- ruby:2.5-alpine: *script
27
27
  end
28
28
 
29
29
  def init(filename)
@@ -1,6 +1,6 @@
1
1
  module AllImages
2
2
  # AllImages version
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.3'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: all_images
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2023-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -66,20 +66,6 @@ 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'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: tins
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
140
  - !ruby/object:Gem::Version
155
141
  version: '0'
156
142
  requirements: []
157
- rubygems_version: 3.3.17
143
+ rubygems_version: 3.3.26
158
144
  signing_key:
159
145
  specification_version: 4
160
146
  summary: Runs a script in all of the docker images