From c6b7192ad92b864e9b65f0f1ec2a7e43e505b9c8 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 25 Nov 2020 17:14:59 +0100 Subject: [PATCH] modulesync 5.3.0 --- .editorconfig | 3 ++- .github/CONTRIBUTING.md | 42 ++++-------------------------- .github/workflows/ci.yml | 18 +++++++++++++ .github/workflows/release.yml | 22 ++++++++++++++++ .gitignore | 3 +++ .msync.yml | 5 +++- .overcommit.yml | 3 ++- .pmtignore | 20 ++++++++++++-- .puppet-lint.rc | 3 +++ .rspec | 3 +++ .rspec_parallel | 3 +++ .rubocop.yml | 3 +++ .sync.yml | 22 ---------------- .travis.yml | 49 ----------------------------------- .yardopts | 2 -- Dockerfile | 7 +++-- Gemfile | 48 ++++++++++++---------------------- Rakefile | 30 ++++++++++++++++----- spec/spec_helper.rb | 15 +++++------ 19 files changed, 139 insertions(+), 162 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .puppet-lint.rc delete mode 100644 .travis.yml delete mode 100644 .yardopts diff --git a/.editorconfig b/.editorconfig index d77700e3..ecb10a80 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,7 @@ # editorconfig.org -# MANAGED BY MODULESYNC +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ root = true diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cace33e6..8b466cfb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -25,7 +25,7 @@ By participating in this project you agree to abide by its terms. * Fork the repo. * Create a separate branch for your change. -* We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org) runs the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix). +* We only take pull requests with passing tests, and documentation. [GitHub Actions](https://docs.github.com/en/actions) run the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix). * Checkout [our docs](https://voxpupuli.org/docs/reviewing_pr/) we use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html). They provide some guidance for new code that might help you before you submit a pull request. * Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test. * Squash your commits down into logical components. Make sure to rebase against our current master. @@ -124,7 +124,7 @@ If you have Ruby 2.x or want a specific version of Puppet, you must set an environment variable such as: ```sh -export PUPPET_VERSION="~> 5.5.6" +export PUPPET_GEM_VERSION="~> 6.1.0" ``` You can install all needed gems for spec tests into the modules directory by @@ -232,52 +232,20 @@ simple tests against it after applying the module. You can run this with: ```sh -bundle exec rake acceptance -``` - -This will run the tests on the module's default nodeset. You can override the -nodeset used, e.g., - -```sh -BEAKER_set=centos-7-x64 bundle exec rake acceptance -``` - -There are default rake tasks for the various acceptance test modules, e.g., - -```sh -bundle exec rake beaker:centos-7-x64 -bundle exec rake beaker:ssh:centos-7-x64 -``` - -If you don't want to have to recreate the virtual machine every time you can -use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at -least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the -created virtual machines will be in `.vagrant/beaker_vagrant_files`. - -Beaker also supports docker containers. We also use that in our automated CI -pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant: - -```sh -PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian10-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker +BEAKER_setfile=debian11-64 bundle exec rake beaker ``` You can replace the string `debian10` with any common operating system. The following strings are known to work: -* ubuntu1604 * ubuntu1804 * ubuntu2004 -* debian9 * debian10 -* centos6 +* debian11 * centos7 * centos8 -The easiest way to debug in a docker container is to open a shell: - -```sh -docker exec -it -u root ${container_id_or_name} bash -``` +For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests). The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb) repository. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8a077911 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: CI + +on: pull_request + +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true + +jobs: + puppet: + name: Puppet + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1 + with: + pidfile_workaround: 'false' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..15f17213 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + name: Release + uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1 + with: + allowed_owner: 'voxpupuli' + secrets: + # Configure secrets here: + # https://docs.github.com/en/actions/security-guides/encrypted-secrets + username: ${{ secrets.PUPPET_FORGE_USERNAME }} + api_key: ${{ secrets.PUPPET_FORGE_API_KEY }} diff --git a/.gitignore b/.gitignore index e9b3cf4b..9b95224c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + pkg/ Gemfile.lock Gemfile.local diff --git a/.msync.yml b/.msync.yml index 5758aced..02353859 100644 --- a/.msync.yml +++ b/.msync.yml @@ -1,2 +1,5 @@ --- -modulesync_config_version: '3.1.0' +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +modulesync_config_version: '5.3.0' diff --git a/.overcommit.yml b/.overcommit.yml index 0af0fdc0..d367adae 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -1,4 +1,5 @@ -# Managed by https://github.com/voxpupuli/modulesync_configs +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # # Hooks are only enabled if you take action. # diff --git a/.pmtignore b/.pmtignore index 4e6d54b8..65f50514 100644 --- a/.pmtignore +++ b/.pmtignore @@ -1,11 +1,15 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + docs/ pkg/ +Gemfile Gemfile.lock Gemfile.local vendor/ .vendor/ -spec/fixtures/manifests/ -spec/fixtures/modules/ +spec/ +Rakefile .vagrant/ .bundle/ .ruby-version @@ -13,9 +17,21 @@ coverage/ log/ .idea/ .dependencies/ +.github/ .librarian/ Puppetfile.lock *.iml +.editorconfig +.fixtures.yml +.gitignore +.msync.yml +.overcommit.yml +.pmtignore +.rspec +.rspec_parallel +.rubocop.yml +.sync.yml .*.sw? .yardoc/ +.yardopts Dockerfile diff --git a/.puppet-lint.rc b/.puppet-lint.rc new file mode 100644 index 00000000..dd8272c7 --- /dev/null +++ b/.puppet-lint.rc @@ -0,0 +1,3 @@ +--fail-on-warnings +--no-parameter_documentation-check +--no-parameter_types-check diff --git a/.rspec b/.rspec index 8c18f1ab..f634583d 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,5 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + --format documentation --color diff --git a/.rspec_parallel b/.rspec_parallel index e4d136b7..a9a84f85 100644 --- a/.rspec_parallel +++ b/.rspec_parallel @@ -1 +1,4 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + --format progress diff --git a/.rubocop.yml b/.rubocop.yml index 198a3599..53ac1898 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,6 @@ --- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + inherit_gem: voxpupuli-test: rubocop.yml diff --git a/.sync.yml b/.sync.yml index ecfaf514..793b6adc 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,23 +1,6 @@ --- -.travis.yml: - secure: "S+FbvY0fDhzg5uPJZm/mkJCGTUuA2ps2Yay9pPrkjTuCqYcbhjm/NOhXPRWJDONo/3Zo7vQZey9PKcsdK3hznwlfkvB1Ghb/829655lZ2lwHZCoZfGURV/FB+ztjyVT2B/xOwisjz8OGQ8AECOX7l6SjUHzLZWZxpSUWYKTLOAyD+b08jR9eiQBshxjmhxzXl+shHXXRVnGo9TEjPMLXqKpwirNucKjHYdWcYcD+Z1Yfacu3O6Ry4PqCZ0VfRf+ahIbUcnriEke1IF6NU0VquyyaSw1nYrTAUW3bHeRTyAU3Uruh2O+lXRkt8UuxDhFs17JLbrb+0a8odr0mg6kdVowEuPYJSCMEUciyoi6ztHJiVceXK2rge5Yi0jw120wRK/cWxDImc8hUh9atGgE5VzMIzu3DJOcpslVSc+iffCPg3/EVol/Ekg9WVb4s1Vj7XFwjczXVaG7mJVF5HSg0JrP+xz1rTvVLvNaNVtZDvEYphscBBUt8ujqqmz4oICWSNa7wo1JLEd1qBwPk+tgmGr1EB3wvcU12KjKotswSjkG2uqNwKO7b9ETUMOzaIxo5dLOr5pUrV9LCDIBAzkeD8HqX6pNHJE1qhZJxLUWOVaDrQNBbJp6yY5xmkg5oNwykPAGKJXAuzTYlBjYBs7ss9RO/Wpn73ExnHEI9DX43rfo=" spec/spec_helper.rb: mock_with: ':mocha' -spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml: - delete: true -spec/acceptance/nodesets/ec2/image_templates.yaml: - delete: true -spec/acceptance/nodesets/ec2/rhel-73-x64.yml: - delete: true -spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml: - delete: true -spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml: - delete: true -spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml: - delete: true -spec/acceptance/nodesets/archlinux-2-x64.yml: - delete: true - Gemfile: optional: ':test': @@ -25,8 +8,3 @@ Gemfile: version: '~> 1.10.0' ':system_tests': - gem: 'simp-beaker-helpers' - -.rubocop.yml: - default_configs: - Style/SymbolArray: - Enabled: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ed3feaf..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# yamllint disable rule:line-length rule:truthy -os: linux -dist: focal -language: ruby -cache: bundler -before_install: - - yes | gem update --system - - bundle --version -script: - - 'bundle exec rake $CHECK' -jobs: - fast_finish: true - include: - - rvm: 2.4.4 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 5.0" CHECK=test - - rvm: 2.5.3 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls - - rvm: 2.5.3 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 6.0" CHECK=rubocop - - rvm: 2.4.4 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes -branches: - only: - - master - - /^v\d/ -notifications: - email: false - webhooks: https://voxpupu.li/incoming/travis - irc: - on_success: always - on_failure: always - channels: - - "chat.freenode.org#voxpupuli-notifications" -deploy: - provider: puppetforge - username: puppet - password: - secure: "S+FbvY0fDhzg5uPJZm/mkJCGTUuA2ps2Yay9pPrkjTuCqYcbhjm/NOhXPRWJDONo/3Zo7vQZey9PKcsdK3hznwlfkvB1Ghb/829655lZ2lwHZCoZfGURV/FB+ztjyVT2B/xOwisjz8OGQ8AECOX7l6SjUHzLZWZxpSUWYKTLOAyD+b08jR9eiQBshxjmhxzXl+shHXXRVnGo9TEjPMLXqKpwirNucKjHYdWcYcD+Z1Yfacu3O6Ry4PqCZ0VfRf+ahIbUcnriEke1IF6NU0VquyyaSw1nYrTAUW3bHeRTyAU3Uruh2O+lXRkt8UuxDhFs17JLbrb+0a8odr0mg6kdVowEuPYJSCMEUciyoi6ztHJiVceXK2rge5Yi0jw120wRK/cWxDImc8hUh9atGgE5VzMIzu3DJOcpslVSc+iffCPg3/EVol/Ekg9WVb4s1Vj7XFwjczXVaG7mJVF5HSg0JrP+xz1rTvVLvNaNVtZDvEYphscBBUt8ujqqmz4oICWSNa7wo1JLEd1qBwPk+tgmGr1EB3wvcU12KjKotswSjkG2uqNwKO7b9ETUMOzaIxo5dLOr5pUrV9LCDIBAzkeD8HqX6pNHJE1qhZJxLUWOVaDrQNBbJp6yY5xmkg5oNwykPAGKJXAuzTYlBjYBs7ss9RO/Wpn73ExnHEI9DX43rfo=" - on: - tags: true - # all_branches is required to use tags - all_branches: true - # Only publish the build marked with "DEPLOY_TO_FORGE" - condition: "$DEPLOY_TO_FORGE = yes" diff --git a/.yardopts b/.yardopts deleted file mode 100644 index 3687f518..00000000 --- a/.yardopts +++ /dev/null @@ -1,2 +0,0 @@ ---markup markdown ---output-dir docs/ diff --git a/Dockerfile b/Dockerfile index 6fd63422..8dd82d63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ -FROM ruby:2.5.3 +# MANAGED BY MODULESYNC +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +FROM ruby:2.7 WORKDIR /opt/puppet # https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39 RUN mkdir -p /etc/sv -ARG PUPPET_VERSION="~> 6.0" +ARG PUPPET_GEM_VERSION="~> 6.0" ARG PARALLEL_TEST_PROCESSORS=4 # Cache gems diff --git a/Gemfile b/Gemfile index 82733d3d..2936879e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,50 +1,36 @@ -source ENV['GEM_SOURCE'] || "https://rubygems.org" - -def location_for(place, fake_version = nil) - if place =~ /^(git[:@][^#]*)#(.*)/ - [fake_version, { :git => $1, :branch => $2, :require => false }].compact - elsif place =~ /^file:\/\/(.*)/ - ['>= 0', { :path => File.expand_path($1), :require => false }] - else - [place, { :require => false }] - end -end +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 2.1', :require => false - gem 'coveralls', :require => false - gem 'simplecov-console', :require => false - gem 'mocha', '~> 1.10.0', :require => false + gem 'voxpupuli-test', '~> 5.4', :require => false + gem 'coveralls', :require => false + gem 'simplecov-console', :require => false + gem 'puppet_metadata', '~> 1.0', :require => false + gem 'mocha', '~> 1.10.0', :require => false end group :development do - gem 'travis', :require => false - gem 'travis-lint', :require => false gem 'guard-rake', :require => false gem 'overcommit', '>= 0.39.1', :require => false end group :system_tests do - gem 'voxpupuli-acceptance', :require => false - gem 'simp-beaker-helpers', :require => false + gem 'voxpupuli-acceptance', '~> 1.0', :require => false + gem 'simp-beaker-helpers', :require => false end group :release do - gem 'github_changelog_generator', :require => false, :git => 'https://github.com/voxpupuli/github-changelog-generator', :branch => 'voxpupuli_essential_fixes' - gem 'puppet-blacksmith', :require => false - gem 'voxpupuli-release', :require => false - gem 'puppet-strings', '>= 2.2', :require => false + gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5' + gem 'voxpupuli-release', '>= 1.2.0', :require => false + gem 'puppet-strings', '>= 2.2', :require => false end +gem 'rake', :require => false +gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test] - -if facterversion = ENV['FACTER_GEM_VERSION'] - gem 'facter', facterversion.to_s, :require => false, :groups => [:test] -else - gem 'facter', :require => false, :groups => [:test] -end - -ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s +puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0' gem 'puppet', puppetversion, :require => false, :groups => [:test] # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index b450fe7b..f92f0516 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,23 @@ -require 'voxpupuli/test/rake' +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +# Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper), +# otherwise attempt to load it directly. +begin + require 'voxpupuli/test/rake' +rescue LoadError + begin + require 'puppetlabs_spec_helper/rake_tasks' + rescue LoadError + end +end + +# load optional tasks for acceptance +# only available if gem group releases is installed +begin + require 'voxpupuli/acceptance/rake' +rescue LoadError +end # load optional tasks for releases # only available if gem group releases is installed @@ -26,15 +45,14 @@ end begin require 'github_changelog_generator/task' + require 'puppet_blacksmith' GitHubChangelogGenerator::RakeTask.new :changelog do |config| - version = (Blacksmith::Modulefile.new).version - config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/ + metadata = Blacksmith::Modulefile.new + config.future_release = "v#{metadata.version}" if metadata.version =~ /^\d+\.\d+.\d+$/ config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} config.user = 'voxpupuli' - metadata_json = File.join(File.dirname(__FILE__), 'metadata.json') - metadata = JSON.load(File.read(metadata_json)) - config.project = metadata['name'] + config.project = metadata.metadata['name'] end # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 59041394..78e8b77e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,7 @@ -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config +# frozen_string_literal: true + +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ RSpec.configure do |c| c.mock_with :mocha @@ -8,15 +9,13 @@ # puppetlabs_spec_helper will set up coverage if the env variable is set. # We want to do this if lib exists and it hasn't been explicitly set. -ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../../lib', __FILE__)) +ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) require 'voxpupuli/test/spec_helper' if File.exist?(File.join(__dir__, 'default_module_facts.yml')) facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) - if facts - facts.each do |name, value| - add_custom_fact name.to_sym, value - end + facts&.each do |name, value| + add_custom_fact name.to_sym, value end end