puppet_metadata 0.4.0 → 1.0.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: 87b930530ef333350feba4aff3093f9629293280fc03f007b0cc5d1236f4b4e9
4
- data.tar.gz: 4937ff7c9ae29363e548ae246578a6400bbf69690a4a9eb34dcb73d55ce41002
3
+ metadata.gz: 9c9d6561f0093dee6ac521a50bfd507ab2695e192530bb5fdd28dd5264009af3
4
+ data.tar.gz: 688205c5b0991c110f288b2acaa54048c6866eeb2f4ced9d392b87e5ddbad535
5
5
  SHA512:
6
- metadata.gz: 5eebec460da1fef928f71f4c3e2c94e55a138ad060c819046df8ee7b0bdce0d916c2b406f7e1e9e431f7c41e93a91b2950cabd06ddaca4f2896c60a2f3152f05
7
- data.tar.gz: 835e8778b6d21ad36a74953c78e66ab93d2c828ce9b7b5088a7d795ee323749834f22245ea1e41873046b7b74c53f3b04b63d8d33d2415113e7deb46aff9b315
6
+ metadata.gz: 1dfc8d32b372c913d9a86937328f131647f487d546e22cd105547788f3af3396b36049c0c350ee4802baa19d90c00d230acf3bccd6fd8a499170eccb91ec4440
7
+ data.tar.gz: d87f9a1be70d013480f72e319f4a9c8179157eb2425bf1be6ae4acafbe5d908a5ed5aa0cfa67bfb33204087a27b3844a0d1f56d0dab408ffa183beccb45981ed
@@ -1,5 +1,6 @@
1
1
  # A module that provides abstractions around Puppet's metadata format.
2
2
  module PuppetMetadata
3
+ autoload :AIO, 'puppet_metadata/aio'
3
4
  autoload :Beaker, 'puppet_metadata/beaker'
4
5
  autoload :GithubActions, 'puppet_metadata/github_actions'
5
6
  autoload :Metadata, 'puppet_metadata/metadata'
@@ -0,0 +1,58 @@
1
+ module PuppetMetadata
2
+ class AIO
3
+ COMPATIBLE = {
4
+ 'AlmaLinux' => 'RedHat',
5
+ 'Amazon' => 'RedHat',
6
+ 'CentOS' => 'RedHat',
7
+ 'OracleLinux' => 'RedHat',
8
+ 'Rocky' => 'RedHat',
9
+ 'Scientific' => 'RedHat',
10
+ }
11
+
12
+ BUILDS = {
13
+ # RPM-based
14
+ 'RedHat' => {
15
+ '5' => 5..7,
16
+ '6' => 5..7,
17
+ '7' => 5..7,
18
+ '8' => 5..7,
19
+ },
20
+ 'Fedora' => {
21
+ '26' => [5],
22
+ '27' => 5..6,
23
+ '28' => 5..6,
24
+ '29' => 5..6,
25
+ '30' => 5..7,
26
+ '31' => 5..7,
27
+ '32' => 6..7,
28
+ '34' => 6..7,
29
+ },
30
+ 'SLES' => {
31
+ '11' => [7],
32
+ '12' => [7],
33
+ '15' => [7],
34
+ },
35
+ # deb-based
36
+ 'Debian' => {
37
+ '7' => [5],
38
+ '8' => 5..7,
39
+ '9' => 5..7,
40
+ '10' => 5..7,
41
+ },
42
+ 'Ubuntu' => {
43
+ '14.04' => 5..6,
44
+ '16.04' => 5..7,
45
+ '18.04' => 5..7,
46
+ '20.04' => 6..7,
47
+ },
48
+ }
49
+
50
+ def self.find_base_os(os)
51
+ COMPATIBLE.fetch(os, os)
52
+ end
53
+
54
+ def self.has_aio_build?(os, release, puppet_version)
55
+ BUILDS.dig(find_base_os(os), release)&.include?(puppet_version)
56
+ end
57
+ end
58
+ end
@@ -13,6 +13,7 @@ module PuppetMetadata
13
13
  beaker_setfiles: beaker_setfiles(beaker_use_fqdn, beaker_pidfile_workaround),
14
14
  puppet_major_versions: puppet_major_versions,
15
15
  puppet_unit_test_matrix: puppet_unit_test_matrix,
16
+ github_action_test_matrix: github_action_test_matrix,
16
17
  }
17
18
  end
18
19
 
@@ -63,5 +64,31 @@ module PuppetMetadata
63
64
  '2.7'
64
65
  end
65
66
  end
67
+
68
+
69
+ def github_action_test_matrix(use_fqdn: false, pidfile_workaround: false)
70
+ matrix_include = []
71
+
72
+ metadata.operatingsystems.each do |os, releases|
73
+ releases&.each do |release|
74
+ puppet_major_versions.each do |puppet_version|
75
+ next unless AIO.has_aio_build?(os, release, puppet_version[:value])
76
+
77
+ setfile = PuppetMetadata::Beaker.os_release_to_setfile(os, release, use_fqdn: use_fqdn, pidfile_workaround: pidfile_workaround)
78
+ next unless setfile
79
+
80
+ matrix_include << {
81
+ setfile: {
82
+ name: setfile[1],
83
+ value: setfile[0],
84
+ },
85
+ puppet: puppet_version
86
+ }
87
+ end
88
+ end
89
+ end
90
+
91
+ matrix_include
92
+ end
66
93
  end
67
94
  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: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-06 00:00:00.000000000 Z
12
+ date: 2021-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: metadata-json-lint
@@ -127,6 +127,7 @@ files:
127
127
  - README.md
128
128
  - bin/metadata2gha
129
129
  - lib/puppet_metadata.rb
130
+ - lib/puppet_metadata/aio.rb
130
131
  - lib/puppet_metadata/beaker.rb
131
132
  - lib/puppet_metadata/github_actions.rb
132
133
  - lib/puppet_metadata/metadata.rb