Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-yast-rake for 
openSUSE:Factory checked in at 2021-10-12 21:47:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-yast-rake (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-yast-rake.new.2443 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-yast-rake"

Tue Oct 12 21:47:54 2021 rev:35 rq:923663 version:0.2.42

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-yast-rake/rubygem-yast-rake.changes      
2021-07-17 23:36:47.501898973 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-yast-rake.new.2443/rubygem-yast-rake.changes
    2021-10-12 21:48:00.915756789 +0200
@@ -1,0 +2,8 @@
+Wed Oct  6 13:42:23 UTC 2021 - Ladislav Slez??k <[email protected]>
+
+- Fixed running the GitHub Actions locally ("rake actions:run"),
+  allow settting additional Docker options in the YAML config
+  or via DOCKER_OPTIONS environment variable (bsc#1191400)
+- 0.2.42
+
+-------------------------------------------------------------------

Old:
----
  yast-rake-0.2.41.gem

New:
----
  yast-rake-0.2.42.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-yast-rake.spec ++++++
--- /var/tmp/diff_new_pack.RRJyDc/_old  2021-10-12 21:48:01.391757470 +0200
+++ /var/tmp/diff_new_pack.RRJyDc/_new  2021-10-12 21:48:01.395757476 +0200
@@ -21,7 +21,7 @@
 %define rb_build_ruby_abis    %{rb_default_ruby_abi}
 
 Name:           rubygem-yast-rake
-Version:        0.2.41
+Version:        0.2.42
 Release:        0
 %define mod_name yast-rake
 %define mod_full_name %{mod_name}-%{version}

++++++ yast-rake-0.2.41.gem -> yast-rake-0.2.42.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2021-01-22 12:31:49.000000000 +0100
+++ new/VERSION 2021-01-22 12:31:49.000000000 +0100
@@ -1 +1 @@
-0.2.41
+0.2.42
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/tasks/container_runner.rb 
new/lib/tasks/container_runner.rb
--- old/lib/tasks/container_runner.rb   2021-01-22 12:31:49.000000000 +0100
+++ new/lib/tasks/container_runner.rb   2021-01-22 12:31:49.000000000 +0100
@@ -28,8 +28,7 @@
   # @param client [String,nil] the client name, nil or empty string = find
   #   the client automatically
   def run(client)
-    image = find_image
-    container = GithubActions::Container.new(image)
+    container = find_container
     container.pull
     container.start
     container.copy_current_dir
@@ -44,16 +43,16 @@
 
   # find the Docker image to use in the container
   # @return [String] the image name
-  def find_image
+  def find_container
     # explicitly requested image
     image = ENV["DOCKER_IMAGE"]
-    return image if image && !image.empty?
+    return GithubActions::Container.new(image) if image && !image.empty?
 
     # scan the Docker images used in the GitHub Actions
-    images = workflow_images
-    return images.first if images.size == 1
+    containers = workflow_containers
+    return containers.first if containers.size == 1
 
-    if images.empty?
+    if containers.empty?
       error("No Docker image was found in the GitHub Actions")
       puts "Use DOCKER_IMAGE=<name> option for specifying the image name"
       abort
@@ -61,20 +60,36 @@
 
     # multiple images found
     error("Found multiple Docker images in the GitHub Actions:")
-    error(images.inspect)
+    error(containers.map { |c| [c.image, c.options] })
     puts "Use DOCKER_IMAGE=<name> option for specifying the image name"
+    puts "and DOCKER_OPTIONS=<options> option for specifying the extra Docker"
+    puts "command line parameters."
     abort
   end
 
   # extract the Docker images from the GitHub Actions,
   # the duplicates are removed
-  # @return [Array<String>] image names
-  def workflow_images
-    GithubActions::Workflow.read.each_with_object([]) do |workflow, images|
+  # @return [Array<GithubActions::Container>] image names
+  def workflow_containers
+    ret = GithubActions::Workflow.read.each_with_object([]) do |workflow, 
containers|
       workflow.jobs.each do |job|
-        container = job.container
-        images << container if container && !images.include?(container)
+        container_data = job.container
+
+        if container_data.is_a?(String)
+          containers << GithubActions::Container.new(container_data)
+        elsif container_data.is_a?(Hash)
+          # to_s converts missing options (nil) to empty options ("")
+          # to treat these as equal in comparison
+          containers << GithubActions::Container.new(
+            container_data["image"],
+            container_data["options"].to_s
+          )
+        else
+          abort "Unsupported container definition: #{container_data.inspect}"
+        end
       end
     end
+
+    ret.uniq { |c| [c.image, c.options] }
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/tasks/github_actions/github_actions/container.rb 
new/lib/tasks/github_actions/github_actions/container.rb
--- old/lib/tasks/github_actions/github_actions/container.rb    2021-01-22 
12:31:49.000000000 +0100
+++ new/lib/tasks/github_actions/github_actions/container.rb    2021-01-22 
12:31:49.000000000 +0100
@@ -26,7 +26,7 @@
   class Container
     include Colorizer
 
-    attr_reader :image, :container
+    attr_reader :image, :options, :container
 
     # the default timeout in seconds, maximum time for the running container,
     # after the time runs out the container is automatically stopped and 
removed
@@ -43,8 +43,10 @@
 
     # constructor
     # @param image [String] name of the Docker image to use
-    def initialize(image)
+    # @param options [String, nil] extra docker options
+    def initialize(image, options = nil)
       @image = image
+      @options = options
     end
 
     # pull the Docker image, ensure that the latest version is used
@@ -73,7 +75,7 @@
       end
 
       cmd = "docker create #{env_options(ENV_VARIABLES)} --rm --entrypoint " \
-        "#{run} #{image.shellescape} #{args}"
+        "#{run} #{options} #{ENV["DOCKER_OPTIONS"]} #{image.shellescape} 
#{args}"
 
       # contains the container ID
       @container = `#{cmd}`.chomp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/tasks/github_actions/github_actions/job_runner.rb 
new/lib/tasks/github_actions/github_actions/job_runner.rb
--- old/lib/tasks/github_actions/github_actions/job_runner.rb   2021-01-22 
12:31:49.000000000 +0100
+++ new/lib/tasks/github_actions/github_actions/job_runner.rb   2021-01-22 
12:31:49.000000000 +0100
@@ -58,12 +58,29 @@
 
     # pull the Docker image and start the container
     def start_container
-      # prefer the custom image if requested
-      @container = Container.new(image || job.container)
+      @container = find_container
       container.pull
       container.start
     end
 
+    # Get the container configuration
+    # @return [Container] container which should run the job
+    def find_container
+      # prefer the custom image if requested
+      image_name = if image
+        image
+      elsif job.container.is_a?(String)
+        job.container
+      elsif job.container.is_a?(Hash)
+        options = job.container["options"]
+        job.container["image"]
+      else
+        abort "Unsupported container definition: #{job.container.inspect}"
+      end
+
+      Container.new(image_name, options.to_s)
+    end
+
     # run a job step
     # @param step [GithubActions::Step] the step to run
     # @return [Boolean] `true` if the step succeeded, `false` otherwise
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2021-06-24 15:18:38.000000000 +0200
+++ new/metadata        2021-10-07 10:32:30.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: yast-rake
 version: !ruby/object:Gem::Version
-  version: 0.2.41
+  version: 0.2.42
 platform: ruby
 authors:
 - Josef Reidinger
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2021-06-24 00:00:00.000000000 Z
+date: 2021-10-07 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: packaging_rake_tasks

Reply via email to