yast-rake 0.2.44 → 0.2.47

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: b131d89f00dea687fc5d44232d1cf6ce503659ca2ca810d63b17169d69eb5e00
4
- data.tar.gz: 1e2d455ac8ca10a363b7bf89585f8bf0927dd06c94204d222a1384f421b4270d
3
+ metadata.gz: 84beac8fc61a64c1e2395c3bf9353b3af7d82a8114a8ca8bb54ba04d0eb3a5c6
4
+ data.tar.gz: 5b2030a73eb9a16e4295d378e9a9820ecb01b149281270cccbd890b54f3fd3d0
5
5
  SHA512:
6
- metadata.gz: 5a83c6e94d862c23c0f04e84cdf68d48c0aa4b4f51caba4000a6f5106831097c38343b10a553fc83fd3355e37a9b719befab007656b3a1626b2364b76f8db35a
7
- data.tar.gz: 13828bd3771752722aa0fe5eb0c7f8f305b6f447bf8f0310e71c5df33e4810d5f071fa2cdef39cbcdfc17a2eff2e9e4e12b2f37675aff1c6fbda0d5d4b1b9a24
6
+ metadata.gz: 37383c8f09a3e8bbfff98918581fd450454ad2987fe055719e1a1a0bd1055cd30155d009ee498c3863fa56212f1f5c8be387b8f17d3b32bc806d237c317e9a1a
7
+ data.tar.gz: 455c0771c116675915339edeadf390e72bd9537cc09d6a4dae9b8746b906a6fa2ec8896d7df9562a2b673e27585cceb8d2b5df314966f87da7bd908379cc4b11
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.44
1
+ 0.2.47
data/data/targets.yml CHANGED
@@ -98,8 +98,8 @@
98
98
  :sle_latest:
99
99
  obs_api: "https://api.suse.de/"
100
100
  obs_project: "Devel:YaST:Head"
101
- obs_sr_project: "SUSE:SLE-15-SP4:GA"
102
- obs_target: "SUSE_SLE-15-SP4_GA"
101
+ obs_sr_project: "SUSE:SLE-15-SP5:GA"
102
+ obs_target: "SUSE_SLE-15-SP5_GA"
103
103
  :factory:
104
104
  obs_project: "YaST:Head"
105
105
  obs_sr_project: "openSUSE:Factory"
@@ -22,7 +22,7 @@ module GithubActions
22
22
  # Github Actions job
23
23
  # @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
24
24
  class Job
25
- attr_reader :name, :steps, :runs_on, :container, :workflow
25
+ attr_reader :name, :steps, :runs_on, :container, :workflow, :matrix
26
26
 
27
27
  # @param name [String] name of the job
28
28
  # @param data [Hash] data from the workflow YAML file
@@ -32,6 +32,7 @@ module GithubActions
32
32
  @runs_on = data["runs-on"]
33
33
  @container = data["container"]
34
34
  @workflow = workflow
35
+ @matrix = data.fetch("strategy", {})["matrix"]
35
36
 
36
37
  @steps = data["steps"].map do |step|
37
38
  Step.new(self, step)
@@ -78,7 +78,23 @@ module GithubActions
78
78
  abort "Unsupported container definition: #{job.container.inspect}"
79
79
  end
80
80
 
81
- Container.new(image_name, options.to_s)
81
+ Container.new(expand_name(image_name), options.to_s)
82
+ end
83
+
84
+ # replace the ${{ matrix.<value> }} placeholders in the image name
85
+ #
86
+ # @param image_name [String] name of the Docker image
87
+ # @return [String] name with replaced values
88
+ def expand_name(image_name)
89
+ image_name.gsub(/\$\{\{\s*matrix\.[^}]*\}\}/) do |subst|
90
+ name = /\$\{\{\s*matrix\.([^}]*)\}\}/.match(subst)[1].strip
91
+ value = job.matrix ? job.matrix[name] : subst
92
+
93
+ # if the value is an Array use the first value by default
94
+ replacement = value.is_a?(Array) ? value.first : value.to_s
95
+ puts "Using ${{matrix.#{name}}} value: #{replacement.inspect}"
96
+ replacement
97
+ end
82
98
  end
83
99
 
84
100
  # run a job step
data/lib/yast/rake.rb CHANGED
@@ -22,14 +22,19 @@ require_relative "tasks"
22
22
 
23
23
  # yast integration testing takes too long and require osc:build so it create
24
24
  # circle, so replace test dependency with test:unit
25
- task = Rake::Task["package"]
26
- prerequisites = task.prerequisites
25
+ ptask = Rake::Task["package"]
26
+ prerequisites = ptask.prerequisites
27
27
  prerequisites.delete("test")
28
28
 
29
- task.enhance(prerequisites)
29
+ ptask.enhance(prerequisites)
30
30
 
31
31
  yast_submit = ENV["YAST_SUBMIT"] || :factory
32
32
  Yast::Tasks.submit_to(yast_submit.to_sym)
33
+ namespace :osc do
34
+ # This adds to existing desc
35
+ desc "Try YAST_SUBMIT=help rake...."
36
+ task :build
37
+ end
33
38
 
34
39
  Yast::Tasks.configuration do |conf|
35
40
  conf.package_name = File.read("RPMNAME").strip if File.exist?("RPMNAME")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yast-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.44
4
+ version: 0.2.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: packaging_rake_tasks