From 9202a4bf8f88818ab136258a7a73d5dd2c1d69c8 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Thu, 12 Oct 2023 10:43:41 -0500 Subject: [PATCH] [puppetsync] Updates for Puppet 8 (#78) --- .github/workflows/tag_deploy.yml | 4 +-- CHANGELOG | 8 +++++ Gemfile | 34 +++++++++---------- metadata.json | 4 +-- spec/spec_helper.rb | 4 +-- .../modules/test_plugins1/metadata.json | 4 +-- .../modules/test_plugins2/metadata.json | 4 +-- 7 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/tag_deploy.yml b/.github/workflows/tag_deploy.yml index c98aa19..2191ab1 100644 --- a/.github/workflows/tag_deploy.yml +++ b/.github/workflows/tag_deploy.yml @@ -120,10 +120,10 @@ jobs: IS_PRERELASE: ${{ steps.tag-check.outputs.prerelease }} run: | echo "${RELEASE_MESSAGE}" > /tmp/.commit-msg.txt - args=(--file /tmp/.commit-msg.txt) + args=(-F /tmp/.commit-msg.txt) [[ $IS_PRERELASE == yes ]] && args+=(--prerelease) - hub release create ${args[@]} "$TARGET_TAG" + gh release create ${args[@]} "$TARGET_TAG" build-and-attach-rpms: name: Trigger RPM release diff --git a/CHANGELOG b/CHANGELOG index 0a13795..129d1a7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +* Wed Oct 11 2023 Steven Pritchard - 0.12.0 +- [puppetsync] Updates for Puppet 8 + - These updates may include the following: + - Update Gemfile + - Add support for Puppet 8 + - Drop support for Puppet 6 + - Update module dependencies + * Mon Aug 28 2023 Steven Pritchard - 0.11.0 - Add support for Puppet 8, Ruby 3, and stdlib 9 diff --git a/Gemfile b/Gemfile index fdc7aa8..e74c3da 100644 --- a/Gemfile +++ b/Gemfile @@ -4,28 +4,28 @@ # This file is automatically updated as part of a puppet module baseline. # The next baseline sync will overwrite any local changes made to this file. # ------------------------------------------------------------------------------ -gem_sources = ENV.fetch('GEM_SERVERS','https://rubygems.org').split(/[, ]+/) +gem_sources = ENV.fetch('GEM_SERVERS', 'https://rubygems.org').split(%r{[, ]+}) ENV['PDK_DISABLE_ANALYTICS'] ||= 'true' gem_sources.each { |gem_source| source gem_source } group :test do - puppet_version = ENV['PUPPET_VERSION'] || '~> 8' - major_puppet_version = puppet_version.scan(/(\d+)(?:\.|\Z)/).flatten.first.to_i - gem 'rake' - gem 'puppet', puppet_version - gem 'rspec' - gem 'rspec-puppet' + puppet_version = ENV.fetch('PUPPET_VERSION', ['>= 7', '< 9']) + major_puppet_version = Array(puppet_version).first.scan(%r{(\d+)(?:\.|\Z)}).flatten.first.to_i gem 'hiera-puppet-helper' - gem 'puppetlabs_spec_helper' gem 'metadata-json-lint' - gem 'puppet-strings' - gem 'puppet-lint-trailing_comma-check', :require => false - gem 'simp-rspec-puppet-facts', ENV['SIMP_RSPEC_PUPPET_FACTS_VERSION'] || '~> 3.7' - gem 'simp-rake-helpers', ENV['SIMP_RAKE_HELPERS_VERSION'] || ['>= 5.12.1', '< 6'] - gem( 'pdk', ENV['PDK_VERSION'] || ['>= 2.0', '< 4.0'], :require => false) if major_puppet_version > 5 gem 'pathspec', '~> 0.2' if Gem::Requirement.create('< 2.6').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem('pdk', ENV.fetch('PDK_VERSION', ['>= 2.0', '< 4.0']), require: false) if major_puppet_version > 5 + gem 'puppet', puppet_version + gem 'puppetlabs_spec_helper' + gem 'puppet-lint-trailing_comma-check', require: false + gem 'puppet-strings' + gem 'rake' + gem 'rspec' + gem 'rspec-puppet' + gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.21.0', '< 6']) + gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 3.7') end group :development do @@ -35,21 +35,21 @@ group :development do end group :system_tests do + gem 'bcrypt_pbkdf' gem 'beaker' gem 'beaker-rspec' - gem 'simp-beaker-helpers', ENV['SIMP_BEAKER_HELPERS_VERSION'] || ['>= 1.28.0', '< 2'] - gem 'bcrypt_pbkdf' + gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', ['>= 1.32.1', '< 2']) end # Evaluate extra gemfiles if they exist extra_gemfiles = [ - ENV['EXTRA_GEMFILE'] || '', + ENV.fetch('EXTRA_GEMFILE', ''), "#{__FILE__}.project", "#{__FILE__}.local", File.join(Dir.home, '.gemfile'), ] extra_gemfiles.each do |gemfile| if File.file?(gemfile) && File.readable?(gemfile) - eval(File.read(gemfile), binding) + eval(File.read(gemfile), binding) # rubocop:disable Security/Eval end end diff --git a/metadata.json b/metadata.json index fd0cd79..7e5b147 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-simpkv", - "version": "0.11.0", + "version": "0.12.0", "author": "simp", "summary": "SIMPkv providers", "license": "Apache-2.0", @@ -54,7 +54,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.22.1 < 9.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ] } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 01289fa..65ac69f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -88,13 +88,13 @@ def set_hieradata(hieradata) } } - c.trusted_server_facts = true + c.trusted_server_facts = true if c.respond_to?(:trusted_server_facts) c.mock_framework = :rspec c.mock_with :rspec c.module_path = File.join(fixture_path, 'modules') - c.manifest_dir = File.join(fixture_path, 'manifests') + c.manifest_dir = File.join(fixture_path, 'manifests') if c.respond_to?(:manifest_dir) c.hiera_config = File.join(fixture_path,'hieradata','hiera.yaml') diff --git a/spec/support/modules/test_plugins1/metadata.json b/spec/support/modules/test_plugins1/metadata.json index 53d1893..04144e2 100644 --- a/spec/support/modules/test_plugins1/metadata.json +++ b/spec/support/modules/test_plugins1/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-test_plugins1", - "version": "9.9.9", + "version": "9.10.0", "author": "simp", "summary": "plugins for simpkv error testing", "license": "Apache-2.0", @@ -16,7 +16,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ] } diff --git a/spec/support/modules/test_plugins2/metadata.json b/spec/support/modules/test_plugins2/metadata.json index 3757e8e..8e18d1c 100644 --- a/spec/support/modules/test_plugins2/metadata.json +++ b/spec/support/modules/test_plugins2/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-test_plugins2", - "version": "9.9.9", + "version": "9.10.0", "author": "simp", "summary": "plugins for simpkv error testing", "license": "Apache-2.0", @@ -16,7 +16,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ] }