puppet_metadata 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +73 -2
- data/bin/metadata2gha +1 -0
- data/lib/puppet_metadata/github_actions.rb +53 -27
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbf0cec07a466deb7e97d1e4c20b75087243573b954c8350c605141f534fe1b9
|
|
4
|
+
data.tar.gz: 3522efe76946069d526bd87ac9023da1b054b0676d4cc0c0b3ac1f476f32c979
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6149d30f3403cbf37f17ccb6d132ce15c86eae5e4d3de16d2dbc96362d5b3e82751e229919fe39afc7fa06528873cfea974ec123aed9165ab7f6f3531c205212
|
|
7
|
+
data.tar.gz: 8d759313fbb484738c39984190d0756712ba0aab483a7f909bebfebc629f9c9b80cf69695bb8690a0c3f23dc3eaa3654f6c80a7cb05b46215d4e89be6494f339
|
data/README.md
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
[](https://rubygems.org/gems/puppet_metadata)
|
|
9
9
|
[](#transfer-notice)
|
|
10
10
|
|
|
11
|
-
The gem intends to provide an abstraction over Puppet's metadata.json file.
|
|
11
|
+
The gem intends to provide an abstraction over Puppet's metadata.json file.
|
|
12
|
+
Its API allow easy iteration over its illogical data structures.
|
|
12
13
|
|
|
13
14
|
- [puppet\_metadata](#puppet_metadata)
|
|
14
15
|
- [New CLI interface in 6.0.0](#new-cli-interface-in-600)
|
|
@@ -126,7 +127,8 @@ Debian => 13
|
|
|
126
127
|
|
|
127
128
|
## Generating Github Actions outputs
|
|
128
129
|
|
|
129
|
-
To get outputs [usable in Github Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions), there is the `metadata2gha` command available.
|
|
130
|
+
To get outputs [usable in Github Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions), there is the `metadata2gha` command available.
|
|
131
|
+
This generates based on metadata.json, such as [Beaker](https://github.com/voxpupuli/beaker) setfiles, Puppet major versions and a Puppet unit test matrix.
|
|
130
132
|
|
|
131
133
|
```console
|
|
132
134
|
$ metadata2gha
|
|
@@ -258,6 +260,75 @@ This results in the following JSON data
|
|
|
258
260
|
]
|
|
259
261
|
```
|
|
260
262
|
|
|
263
|
+
We can also limit the matrix to a specific collection:
|
|
264
|
+
|
|
265
|
+
```console
|
|
266
|
+
$ metadata2gha --collection openvox8
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
[
|
|
271
|
+
{
|
|
272
|
+
"name": "OpenVox 8 - AlmaLinux 8",
|
|
273
|
+
"env": {
|
|
274
|
+
"BEAKER_PUPPET_COLLECTION": "openvox8",
|
|
275
|
+
"BEAKER_SETFILE": "almalinux8-64{hostname=almalinux8-64-openvox8}"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "OpenVox 8 - AlmaLinux 9",
|
|
280
|
+
"env": {
|
|
281
|
+
"BEAKER_PUPPET_COLLECTION": "openvox8",
|
|
282
|
+
"BEAKER_SETFILE": "almalinux9-64{hostname=almalinux9-64-openvox8}"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "OpenVox 8 - CentOS 9",
|
|
287
|
+
"env": {
|
|
288
|
+
"BEAKER_PUPPET_COLLECTION": "openvox8",
|
|
289
|
+
"BEAKER_SETFILE": "centos9-64{hostname=centos9-64-openvox8}"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "OpenVox 8 - Debian 11",
|
|
294
|
+
"env": {
|
|
295
|
+
"BEAKER_PUPPET_COLLECTION": "openvox8",
|
|
296
|
+
"BEAKER_SETFILE": "debian11-64{hostname=debian11-64-openvox8}"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
There is also the special collection `staging`.
|
|
303
|
+
This will generate a matrix for all OS releases with AIO packages.
|
|
304
|
+
The idea is to test unreleased packages.
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
[
|
|
308
|
+
{
|
|
309
|
+
"name": "OpenVox 8 - AlmaLinux 8",
|
|
310
|
+
"env": {
|
|
311
|
+
"BEAKER_PUPPET_COLLECTION": "staging",
|
|
312
|
+
"BEAKER_SETFILE": "almalinux8-64{hostname=almalinux8-64-staging}"
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "OpenVox 8 - AlmaLinux 9",
|
|
317
|
+
"env": {
|
|
318
|
+
"BEAKER_PUPPET_COLLECTION": "staging",
|
|
319
|
+
"BEAKER_SETFILE": "almalinux9-64{hostname=almalinux9-64-staging}"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "OpenVox 8 - CentOS 9",
|
|
324
|
+
"env": {
|
|
325
|
+
"BEAKER_PUPPET_COLLECTION": "staging",
|
|
326
|
+
"BEAKER_SETFILE": "centos9-64{hostname=centos9-64-staging}"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
```
|
|
331
|
+
|
|
261
332
|
## Work with the API
|
|
262
333
|
|
|
263
334
|
The API can be initialised like this:
|
data/bin/metadata2gha
CHANGED
|
@@ -13,6 +13,7 @@ options = {
|
|
|
13
13
|
OptionParser.new do |opts|
|
|
14
14
|
opts.banner = "Usage: #{$0} [options] metadata"
|
|
15
15
|
|
|
16
|
+
opts.on('-c', '--collection VALUE', 'Limit GitHub jobs to only test this specific collection') { |opt| options[:collection] = opt }
|
|
16
17
|
opts.on('-d', '--domain VALUE', 'the domain for the box, only used when --use-fqdn is set to true') { |opt| options[:domain] = opt }
|
|
17
18
|
opts.on('--minimum-major-puppet-version VERSION', "Don't create actions for Puppet versions less than this major version") { |opt| options[:minimum_major_puppet_version] = opt }
|
|
18
19
|
opts.on('--beaker-facter FACT:LABEL:VALUES', 'Expand the matrix based on a fact. Separate values using commas') do |opt|
|
|
@@ -56,37 +56,63 @@ module PuppetMetadata
|
|
|
56
56
|
|
|
57
57
|
def beaker_os_releases(at = nil)
|
|
58
58
|
majors = beaker_major_versions
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
#
|
|
69
|
-
|
|
70
|
-
else
|
|
59
|
+
# for staging, we don't want to have one job per major openvox/puppet version
|
|
60
|
+
# we just want to pull a specific, unreleased, package from a webserver
|
|
61
|
+
# and we only do this for AIO builds, because we don't have other packages
|
|
62
|
+
collection = options[:collection]
|
|
63
|
+
collection = nil if collection&.empty?
|
|
64
|
+
if collection == 'staging'
|
|
65
|
+
latest = majors.first.dup
|
|
66
|
+
latest[:collection] = 'staging'
|
|
67
|
+
metadata.operatingsystems.each do |os, releases|
|
|
68
|
+
# iterates on all releases for one OS
|
|
69
|
+
# `&` in case the OS has no releases in metadata.json
|
|
71
70
|
releases&.each do |release|
|
|
72
|
-
if PuppetMetadata::OperatingSystem.eol?(os, release, at)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
next if PuppetMetadata::OperatingSystem.eol?(os, release, at)
|
|
72
|
+
|
|
73
|
+
yield [os, release, latest] if AIO.has_aio_build?(os, release, latest[:value], latest[:requirement])
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
else
|
|
77
|
+
distro_puppet_version = {
|
|
78
|
+
name: 'Distro Puppet',
|
|
79
|
+
value: nil, # We don't know the version and since it's rolling, it can be anything
|
|
80
|
+
collection: 'none',
|
|
81
|
+
requirement: 'puppet',
|
|
82
|
+
}
|
|
83
|
+
metadata.operatingsystems.each do |os, releases|
|
|
84
|
+
case os
|
|
85
|
+
when 'Archlinux', 'Gentoo'
|
|
86
|
+
# we filter out the rolling distributions because we don't know which openvox/puppet version we get and we want a specific collection
|
|
87
|
+
next if collection
|
|
88
|
+
|
|
89
|
+
# both currently only ship puppet, not openvox yet
|
|
90
|
+
yield [os, 'rolling', distro_puppet_version]
|
|
91
|
+
else
|
|
92
|
+
releases&.each do |release|
|
|
93
|
+
if PuppetMetadata::OperatingSystem.eol?(os, release, at)
|
|
94
|
+
message = "Skipping EOL operating system #{os} #{release}"
|
|
95
|
+
|
|
96
|
+
if ENV.key?('GITHUB_ACTIONS')
|
|
97
|
+
# TODO: determine file and position within the file
|
|
98
|
+
puts "::warning file=metadata.json::#{message}"
|
|
99
|
+
else
|
|
100
|
+
warn message
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
next
|
|
80
104
|
end
|
|
81
105
|
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
majors.each do |puppet_version|
|
|
107
|
+
# if a collection is set, it's not 'staging'
|
|
108
|
+
# we then want to filter out all results that don't match our provided collection
|
|
109
|
+
next if collection && puppet_version[:collection] != collection
|
|
84
110
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
111
|
+
if AIO.has_aio_build?(os, release, puppet_version[:value], puppet_version[:requirement])
|
|
112
|
+
yield [os, release, puppet_version]
|
|
113
|
+
elsif PuppetMetadata::OperatingSystem.os_release_puppet_version(os, release) == puppet_version[:value]
|
|
114
|
+
yield [os, release, distro_puppet_version.merge(value: puppet_version[:value])]
|
|
115
|
+
end
|
|
90
116
|
end
|
|
91
117
|
end
|
|
92
118
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puppet_metadata
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vox Pupuli
|
|
@@ -118,14 +118,14 @@ dependencies:
|
|
|
118
118
|
requirements:
|
|
119
119
|
- - "~>"
|
|
120
120
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: 5.
|
|
121
|
+
version: 5.2.0
|
|
122
122
|
type: :development
|
|
123
123
|
prerelease: false
|
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
|
125
125
|
requirements:
|
|
126
126
|
- - "~>"
|
|
127
127
|
- !ruby/object:Gem::Version
|
|
128
|
-
version: 5.
|
|
128
|
+
version: 5.2.0
|
|
129
129
|
- !ruby/object:Gem::Dependency
|
|
130
130
|
name: yard
|
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
191
191
|
- !ruby/object:Gem::Version
|
|
192
192
|
version: '0'
|
|
193
193
|
requirements: []
|
|
194
|
-
rubygems_version: 4.0.
|
|
194
|
+
rubygems_version: 4.0.6
|
|
195
195
|
specification_version: 4
|
|
196
196
|
summary: Data structures for the Puppet Metadata
|
|
197
197
|
test_files: []
|