all_images 0.4.0 → 0.5.0

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: 5084009dccb97a9ac38c578c60e7f0dc8167995ab5ca374462d19e1b3ea69187
4
- data.tar.gz: 29429c6b5e83d764e2855ab13586f9973e3daba03d3d3503d18eb221890c386d
3
+ metadata.gz: 05e803f38074cc12ba26b4720f6fadc89e2e4a684ae9755b60d97773c4f8992f
4
+ data.tar.gz: 42864bc243ebf51e1c72285bdbcc7cd1fe37620120bbdfe16d71a4867d73f1e9
5
5
  SHA512:
6
- metadata.gz: 313d6f61b128dac3faa34e7866302d98f4f58a8f4ef2c92564d51442b153a0130300f48361068ff4ca6ea61254e613a0ec49267268ea3ef4bfef6378f48cc06c
7
- data.tar.gz: 1576ef30edd69521581012b8a1582b39d5ba7a57549be7434adb5f9c275d543c10ecd0c9300a1c4419ee2e53ea0774c5436a523cd7899225f918c56de63c1a07
6
+ metadata.gz: 1c7900c9400afa3ec720879299212395cb63a77bcba30a02c8d31f687df1d23c697b41e139b5e262e418a42e91d50166af6fd6438c42de73e79364401c24b6df
7
+ data.tar.gz: efc3e9241153ee54b8cc5ce2701040be5ab0b5cd0181b89744c891f2caf8fedbfcc7fde069ca57783997dec763485c1f3da6785c89edfab6151929963ea5afa6
data/CHANGES.md ADDED
@@ -0,0 +1,77 @@
1
+ # Changes
2
+
3
+ ## 2024-09-01 v0.5.0
4
+
5
+ * **Update image processing for parallel execution**:
6
+ + Added random suffix to image names to prevent conflicts between concurrent processes.
7
+ * Added `CHANGES.md` file
8
+
9
+ ## 2024-08-08 v0.4.1
10
+
11
+ * **License File Added**: A license file was added in written form.
12
+
13
+ ## 2024-02-07 v0.4.0
14
+
15
+ * Added support for outputting colors in addition to existing functionality.
16
+
17
+ ## 2023-08-17 v0.3.0
18
+
19
+ * **New Feature**: Allow running scripts within a Docker container, enabling
20
+ more flexible and isolated testing environments.
21
+
22
+ ## 2023-08-17 v0.2.5
23
+
24
+ * Corrected actual checking logic.
25
+
26
+ ## 2023-08-17 v0.2.4
27
+
28
+ * **Improved Error Handling**:
29
+ * Added checks to prevent premature failure in critical sections of the code.
30
+
31
+ ## 2023-06-01 v0.2.3
32
+
33
+ * **New Features**
34
+ + Added support for Ruby 3.2
35
+ * **Changes**
36
+ + Bumped build version
37
+ + Removed support for Ruby 2.5
38
+ * **Bug Fixes**
39
+ + Repaired `fail_fast` mode
40
+
41
+ ## 2023-04-19 v0.2.2
42
+
43
+ * **New Version Features**
44
+ + Progress into the future of ruby development
45
+ + Progress into the future
46
+ * **Significant Changes**
47
+ + Removed development dependency (again)
48
+
49
+ ## 2022-11-17 v0.2.1
50
+
51
+ * Added a new `help` command.
52
+
53
+ ## 2022-11-17 v0.2.0
54
+
55
+ * **New Features**
56
+ + Added commands to run and debug single images
57
+ + Added a debug debugger feature
58
+
59
+ ## 2022-11-17 v0.1.0
60
+
61
+ * Added `fail_fast` configuration option.
62
+
63
+ ## 2022-07-11 v0.0.2
64
+
65
+ * **Security Fix**: Local config files are now properly sanitized to prevent potential security vulnerabilities.
66
+
67
+ ## 2022-05-16 v0.0.1
68
+
69
+ * **Bug Fix**: Fixed bug in `required_ruby_version` functionality, which was causing issues with certain RubyGems releases.
70
+
71
+ ### Significant Changes
72
+ * Removed buggy implementation of `required_ruby_version`
73
+ * Improved stability and compatibility with RubyGems releases
74
+
75
+ ## 2022-05-15 v0.0.0
76
+
77
+ * Start
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright Florian Frank
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the “Software”), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
data/Rakefile CHANGED
@@ -6,12 +6,12 @@ GemHadar do
6
6
  name 'all_images'
7
7
  author 'Florian Frank'
8
8
  email 'flori@ping.de'
9
- homepage "http://github.com/flori/#{name}"
9
+ homepage "https://github.com/flori/#{name}"
10
10
  summary 'Runs a script in all of the docker images'
11
11
  description 'A script that runs a script in all of the configured docker images'
12
12
  test_dir 'spec'
13
13
  ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', 'coverage',
14
- '.AppleDouble', 'tags', '.byebug_history', '.DS_Store'
14
+ '.AppleDouble', 'tags', '.DS_Store'
15
15
  readme 'README.md'
16
16
  title "#{name.camelize} -- #{summary}"
17
17
  package_ignore '.all_images.yml', '.gitignore', 'VERSION'
data/all_images.gemspec CHANGED
@@ -1,33 +1,33 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: all_images 0.4.0 ruby lib
2
+ # stub: all_images 0.5.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "all_images".freeze
6
- s.version = "0.4.0"
6
+ s.version = "0.5.0".freeze
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 = "2024-02-07"
11
+ s.date = "2024-08-31"
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]
15
15
  s.extra_rdoc_files = ["README.md".freeze, "lib/all_images.rb".freeze, "lib/all_images/app.rb".freeze, "lib/all_images/config.rb".freeze, "lib/all_images/version.rb".freeze]
16
- s.files = [".utilsrc".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "all_images.gemspec".freeze, "bin/all_images".freeze, "lib/all_images.rb".freeze, "lib/all_images/app.rb".freeze, "lib/all_images/config.rb".freeze, "lib/all_images/version.rb".freeze, "spec/spec_helper.rb".freeze]
17
- s.homepage = "http://github.com/flori/all_images".freeze
16
+ s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "all_images.gemspec".freeze, "bin/all_images".freeze, "lib/all_images.rb".freeze, "lib/all_images/app.rb".freeze, "lib/all_images/config.rb".freeze, "lib/all_images/version.rb".freeze, "spec/app_spec.rb".freeze, "spec/spec_helper.rb".freeze]
17
+ s.homepage = "https://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.4.10".freeze
20
+ s.rubygems_version = "3.5.16".freeze
21
21
  s.summary = "Runs a script in all of the docker images".freeze
22
- s.test_files = ["spec/spec_helper.rb".freeze]
22
+ s.test_files = ["spec/app_spec.rb".freeze, "spec/spec_helper.rb".freeze]
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.12.0"])
27
- s.add_development_dependency(%q<rake>.freeze, [">= 0"])
28
- s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
29
- s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
30
- s.add_development_dependency(%q<debug>.freeze, [">= 0"])
31
- s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0"])
32
- s.add_runtime_dependency(%q<term-ansicolor>.freeze, [">= 0"])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.17.0".freeze])
27
+ s.add_development_dependency(%q<rake>.freeze, [">= 0".freeze])
28
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
29
+ s.add_development_dependency(%q<rspec>.freeze, [">= 0".freeze])
30
+ s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
31
+ s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0".freeze])
32
+ s.add_runtime_dependency(%q<term-ansicolor>.freeze, [">= 0".freeze])
33
33
  end
@@ -1,6 +1,7 @@
1
1
  require 'term/ansicolor'
2
2
  require 'tmpdir'
3
3
  require 'fileutils'
4
+ require 'tins'
4
5
 
5
6
  class AllImages::App
6
7
  include Term::ANSIColor
@@ -12,6 +13,7 @@ class AllImages::App
12
13
  @args = args.dup
13
14
  @command = pick_command
14
15
  @commands = %w[ ls help run debug run_all ].sort
16
+ @suffix = Tins::Token.new(alphabet: Tins::Token::BASE32_ALPHABET, bits: 32)
15
17
  end
16
18
 
17
19
  def run
@@ -43,16 +45,20 @@ class AllImages::App
43
45
 
44
46
  private
45
47
 
48
+ def name
49
+ [ 'all_images', @suffix ] * ?-
50
+ end
51
+
46
52
  def run_image(image, script, interactive: false)
47
53
  dockerfile = @config.fetch('dockerfile').to_s
48
54
  tag = provide_image image, dockerfile, script
49
55
  term = ENV.key?('TERM') ? %{ -e TERM=#{ENV['TERM'].inspect} } : ' '
50
56
  if interactive
51
57
  puts "You can run /script interactively now."
52
- sh "docker run --name all_images -it #{term}-v `pwd`:/work '#{tag}' sh"
58
+ sh "docker run --name #{name} -it #{term}-v `pwd`:/work '#{tag}' sh"
53
59
  return 0
54
60
  else
55
- if sh "docker run --name all_images -it #{term}-v `pwd`:/work '#{tag}' sh -c /script"
61
+ if sh "docker run --name #{name} -it #{term}-v `pwd`:/work '#{tag}' sh -c /script"
56
62
  puts green('SUCCESS')
57
63
  return 0
58
64
  else
@@ -61,7 +67,7 @@ class AllImages::App
61
67
  end
62
68
  end
63
69
  ensure
64
- sh 'docker rm -f all_images >/dev/null'
70
+ sh "docker rm -f #{name} >/dev/null"
65
71
  end
66
72
 
67
73
  def pick_command
@@ -19,11 +19,10 @@ module AllImages::Config
19
19
  rake test
20
20
 
21
21
  images:
22
+ ruby:3.3-alpine: *script
22
23
  ruby:3.2-alpine: *script
23
24
  ruby:3.1-alpine: *script
24
25
  ruby:3.0-alpine: *script
25
- ruby:2.7-alpine: *script
26
- ruby:2.6-alpine: *script
27
26
  end
28
27
 
29
28
  def init(filename)
@@ -1,6 +1,6 @@
1
1
  module AllImages
2
2
  # AllImages version
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
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:
data/spec/app_spec.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe AllImages::App do
4
+ it 'can be instantiated' do
5
+ expect(described_class.new([])).to be_a described_class
6
+ end
7
+ end
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@ if ENV['START_SIMPLECOV'].to_i == 1
6
6
  end
7
7
  require 'rspec'
8
8
  begin
9
- require 'byebug'
9
+ require 'debug'
10
10
  rescue LoadError
11
11
  end
12
12
  require 'all_images'
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.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-07 00:00:00.000000000 Z
11
+ date: 2024-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.12.0
19
+ version: 1.17.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.12.0
26
+ version: 1.17.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,9 @@ extra_rdoc_files:
121
121
  - lib/all_images/version.rb
122
122
  files:
123
123
  - ".utilsrc"
124
+ - CHANGES.md
124
125
  - Gemfile
126
+ - LICENSE
125
127
  - README.md
126
128
  - Rakefile
127
129
  - all_images.gemspec
@@ -130,8 +132,9 @@ files:
130
132
  - lib/all_images/app.rb
131
133
  - lib/all_images/config.rb
132
134
  - lib/all_images/version.rb
135
+ - spec/app_spec.rb
133
136
  - spec/spec_helper.rb
134
- homepage: http://github.com/flori/all_images
137
+ homepage: https://github.com/flori/all_images
135
138
  licenses:
136
139
  - MIT
137
140
  metadata: {}
@@ -154,9 +157,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
157
  - !ruby/object:Gem::Version
155
158
  version: '0'
156
159
  requirements: []
157
- rubygems_version: 3.4.10
160
+ rubygems_version: 3.5.16
158
161
  signing_key:
159
162
  specification_version: 4
160
163
  summary: Runs a script in all of the docker images
161
164
  test_files:
165
+ - spec/app_spec.rb
162
166
  - spec/spec_helper.rb