puppet_metadata 3.2.0 → 3.4.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/bin/metadata2gha +10 -0
- data/lib/puppet_metadata/github_actions.rb +51 -4
- 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: 556224029dca3954a88bc2965c547e73976f2dfcff434ec8c4404b116c73ac8b
         | 
| 4 | 
            +
              data.tar.gz: 6f6101c35a3d4bad3a4f575dac4de02788dd454bec93a2a7a6d3328d8f576402
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c54f5c54e35607a332ed08006c387511b089066f2b9f330a1feb89ee691cb1b4aa062f7246eb5f025a3125a7ce36122ac8fbe7f1c394e757bb2d736957dda558
         | 
| 7 | 
            +
              data.tar.gz: 9b114a9fb73bfe479a0ea425565c3b2bf98228a756a281caadb6ea262fffd1e746dfe706cac85cd6f06e4191812aa4e98e1b975209113495cb8fff146d7d47b6
         | 
    
        data/bin/metadata2gha
    CHANGED
    
    | @@ -10,6 +10,7 @@ options = { | |
| 10 10 | 
             
              beaker_pidfile_workaround: false,
         | 
| 11 11 | 
             
              domain: nil,
         | 
| 12 12 | 
             
              minimum_major_puppet_version: nil,
         | 
| 13 | 
            +
              beaker_fact: nil,
         | 
| 13 14 | 
             
            }
         | 
| 14 15 |  | 
| 15 16 | 
             
            OptionParser.new do |opts|
         | 
| @@ -30,6 +31,15 @@ OptionParser.new do |opts| | |
| 30 31 | 
             
              opts.on('--pidfile-workaround VALUE', 'Generate the systemd PIDFile workaround to work around a docker bug', PidfileWorkaround) { |opt| options[:beaker_pidfile_workaround] = opt }
         | 
| 31 32 | 
             
              opts.on('-d', '--domain VALUE', 'the domain for the box, only used when --use-fqdn is set to true') { |opt| options[:domain] = opt }
         | 
| 32 33 | 
             
              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 }
         | 
| 34 | 
            +
              opts.on('--beaker-facter FACT:LABEL:VALUES', 'Expand the matrix based on a fact. Separate values using commas') do |opt|
         | 
| 35 | 
            +
                if opt != 'false'
         | 
| 36 | 
            +
                  fact, label, values = opt.split(':', 3)
         | 
| 37 | 
            +
                  label = fact if !label || label.empty?
         | 
| 38 | 
            +
                  raise OptionParser::InvalidArgument unless values
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                  options[:beaker_facter] = [fact, label, values.split(',')]
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
              end
         | 
| 33 43 | 
             
            end.parse!
         | 
| 34 44 |  | 
| 35 45 | 
             
            filename = ARGV[0]
         | 
| @@ -14,6 +14,8 @@ module PuppetMetadata | |
| 14 14 | 
             
                  {
         | 
| 15 15 | 
             
                    puppet_major_versions: puppet_major_versions,
         | 
| 16 16 | 
             
                    puppet_unit_test_matrix: puppet_unit_test_matrix,
         | 
| 17 | 
            +
                    puppet_beaker_test_matrix: puppet_beaker_test_matrix,
         | 
| 18 | 
            +
                    # Deprecated
         | 
| 17 19 | 
             
                    github_action_test_matrix: github_action_test_matrix,
         | 
| 18 20 | 
             
                  }
         | 
| 19 21 | 
             
                end
         | 
| @@ -70,17 +72,51 @@ module PuppetMetadata | |
| 70 72 | 
             
                  end
         | 
| 71 73 | 
             
                end
         | 
| 72 74 |  | 
| 73 | 
            -
                def  | 
| 75 | 
            +
                def puppet_beaker_test_matrix
         | 
| 74 76 | 
             
                  matrix_include = []
         | 
| 75 77 |  | 
| 76 78 | 
             
                  beaker_os_releases do |os, release, puppet_version|
         | 
| 77 | 
            -
                     | 
| 78 | 
            -
             | 
| 79 | 
            -
                    )
         | 
| 79 | 
            +
                    next if puppet_version_below_minimum?(puppet_version[:value])
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                    setfile = os_release_to_beaker_setfile(os, release, puppet_version[:collection])
         | 
| 80 82 | 
             
                    next unless setfile
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                    name = "#{puppet_version[:name]} - #{setfile[1]}"
         | 
| 85 | 
            +
                    env = {
         | 
| 86 | 
            +
                      'BEAKER_PUPPET_COLLECTION' => puppet_version[:collection],
         | 
| 87 | 
            +
                      'BEAKER_SETFILE' => setfile[0],
         | 
| 88 | 
            +
                    }
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                    if options[:beaker_facter]
         | 
| 91 | 
            +
                      fact, label, values = options[:beaker_facter]
         | 
| 92 | 
            +
                      values.each do |value|
         | 
| 93 | 
            +
                        matrix_include << {
         | 
| 94 | 
            +
                          name: "#{name} - #{label || fact} #{value}",
         | 
| 95 | 
            +
                          env: env.merge("BEAKER_FACTER_#{fact}" => value),
         | 
| 96 | 
            +
                        }
         | 
| 97 | 
            +
                      end
         | 
| 98 | 
            +
                    else
         | 
| 99 | 
            +
                      matrix_include << {
         | 
| 100 | 
            +
                        name: name,
         | 
| 101 | 
            +
                        env: env,
         | 
| 102 | 
            +
                      }
         | 
| 103 | 
            +
                    end
         | 
| 104 | 
            +
                  end
         | 
| 105 | 
            +
             | 
| 106 | 
            +
                  matrix_include
         | 
| 107 | 
            +
                end
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                def github_action_test_matrix
         | 
| 110 | 
            +
                  matrix_include = []
         | 
| 111 | 
            +
             | 
| 112 | 
            +
                  beaker_os_releases do |os, release, puppet_version|
         | 
| 81 113 | 
             
                    next if puppet_version_below_minimum?(puppet_version[:value])
         | 
| 82 114 |  | 
| 115 | 
            +
                    setfile = os_release_to_beaker_setfile(os, release, puppet_version[:collection])
         | 
| 116 | 
            +
                    next unless setfile
         | 
| 117 | 
            +
             | 
| 83 118 | 
             
                    matrix_include << {
         | 
| 119 | 
            +
                      name: "#{puppet_version[:name]} - #{setfile[1]}",
         | 
| 84 120 | 
             
                      setfile: {
         | 
| 85 121 | 
             
                        name: setfile[1],
         | 
| 86 122 | 
             
                        value: setfile[0],
         | 
| @@ -97,5 +133,16 @@ module PuppetMetadata | |
| 97 133 |  | 
| 98 134 | 
             
                  Gem::Version.new(version) < Gem::Version.new(options[:minimum_major_puppet_version])
         | 
| 99 135 | 
             
                end
         | 
| 136 | 
            +
             | 
| 137 | 
            +
                def os_release_to_beaker_setfile(os, release, puppet_collection)
         | 
| 138 | 
            +
                  PuppetMetadata::Beaker.os_release_to_setfile(
         | 
| 139 | 
            +
                    os,
         | 
| 140 | 
            +
                    release,
         | 
| 141 | 
            +
                    use_fqdn: options[:beaker_use_fqdn],
         | 
| 142 | 
            +
                    pidfile_workaround: options[:beaker_pidfile_workaround],
         | 
| 143 | 
            +
                    domain: options[:domain],
         | 
| 144 | 
            +
                    puppet_version: puppet_collection,
         | 
| 145 | 
            +
                  )
         | 
| 146 | 
            +
                end
         | 
| 100 147 | 
             
              end
         | 
| 101 148 | 
             
            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: 3. | 
| 4 | 
            +
              version: 3.4.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: 2023- | 
| 12 | 
            +
            date: 2023-10-11 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: metadata-json-lint
         | 
| @@ -20,7 +20,7 @@ dependencies: | |
| 20 20 | 
             
                    version: '2.0'
         | 
| 21 21 | 
             
                - - "<"
         | 
| 22 22 | 
             
                  - !ruby/object:Gem::Version
         | 
| 23 | 
            -
                    version: ' | 
| 23 | 
            +
                    version: '5'
         | 
| 24 24 | 
             
              type: :runtime
         | 
| 25 25 | 
             
              prerelease: false
         | 
| 26 26 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| @@ -30,7 +30,7 @@ dependencies: | |
| 30 30 | 
             
                    version: '2.0'
         | 
| 31 31 | 
             
                - - "<"
         | 
| 32 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            -
                    version: ' | 
| 33 | 
            +
                    version: '5'
         | 
| 34 34 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 35 35 | 
             
              name: semantic_puppet
         | 
| 36 36 | 
             
              requirement: !ruby/object:Gem::Requirement
         |