Skip to content

Commit

Permalink
Sync with Vox Pupuli
Browse files Browse the repository at this point in the history
Sync our config with the one from Vox Pupuli which has support for
running CI against Puppet 8.
  • Loading branch information
smortex committed Jun 27, 2023
1 parent 109fb5e commit 6816d67
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 109 deletions.
52 changes: 41 additions & 11 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,41 @@
.github/SECURITY.md:
delete: true
.github/workflows/ci.yml:
beaker_fact_matrix: {}
excludes: []
pidfile_workaround: false
timeout_minutes: 40
additional_packages: ''
acceptance_tests: true
# PDK creates this
.github/workflows/puppet-lint.yml:
delete: true
.travis.yml:
delete: true
Jenkinsfile:
delete: true
Gemfile:
puppet_version: '>= 6.0'
puppet_version: '~> 7.24'
required:
':test':
- gem: voxpupuli-test
version: '~> 5.0'
version: '~> 6.0'
- gem: coveralls
- gem: simplecov-console
- gem: puppet_metadata
version: '~> 1.0'
version: '~> 3.0'
':development':
- gem: guard-rake
- gem: overcommit
version: '>= 0.39.1'
':system_tests':
- gem: voxpupuli-acceptance
version: '~> 1.0'
version: '~> 2.0'
':release':
- gem: github_changelog_generator
version: '>= 1.16.1'
ruby-version: '2.5'
ruby-operator: '>='
- gem: voxpupuli-release
version: '>= 1.2.0'
- gem: puppet-strings
version: '>= 2.2'
version: '~> 3.0'
- gem: faraday-retry
version: '~> 2.1'
Rakefile:
config.user: ccin2p3
puppet_strings_patterns: []
Expand All @@ -61,6 +62,8 @@ spec/default_facts.yml:
delete: true
spec/classes/coverage_spec.rb:
delete: true
spec/acceptance/nodesets/default.yml:
delete: true
spec/acceptance/nodesets/archlinux-2-x64.yml:
delete: true
spec/acceptance/nodesets/centos-511-x64.yml:
Expand Down Expand Up @@ -89,6 +92,16 @@ spec/acceptance/nodesets/fedora-26-x64.yml:
delete: true
spec/acceptance/nodesets/fedora-27-x64.yml:
delete: true
spec/acceptance/nodesets/debian-7-x64.yml:
delete: true
spec/acceptance/nodesets/debian-8-x64.yml:
delete: true
spec/acceptance/nodesets/sles-11-x64.yml:
delete: true
spec/acceptance/nodesets/sles-12-x64.yml:
delete: true
spec/acceptance/nodesets/ubuntu-1604-x64.yml:
delete: true
spec/acceptance/nodesets/ubuntu-server-1204-x64.yml:
delete: true
spec/acceptance/nodesets/ubuntu-server-1404-x64.yml:
Expand All @@ -114,9 +127,12 @@ spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml:
spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml:
delete: true
spec/spec_helper.rb:
add_mocked_facts: true
mock_with: false
spec/spec_helper_acceptance.rb:
unmanaged: true
configure_beaker:
modules: ':metadata'
CONTRIBUTING.md:
delete: true
.yardopts:
Expand All @@ -130,5 +146,19 @@ appveyor.yml:
delete: true
pdk.yaml:
delete: true
.ruby-version:
delete: true
.tool-versions:
delete: true
CODE_OF_CONDUCT.md:
delete: true
.github/CODE_OF_CONDUCT.md:
delete: true
SECURITY.md:
delete: true
.github/SECURITY.md:
delete: true
Modulefile:
delete: true
...
# vim: syntax=yaml
10 changes: 6 additions & 4 deletions moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: '<%= @configs['pidfile_workaround'] %>'
<%- unless @configs['additional_packages'].empty? -%>
additional_packages: '<%= @configs['additional_packages'] %>'
<%- end -%>
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1
<%- unless @configs['additional_packages'].empty? -%>
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? -%>
with:
<%- end -%>
<%- end -%>
<%- unless @configs['additional_packages'].empty? -%>
additional_packages: '<%= @configs['additional_packages'] %>'
<%- end -%>
<%- if @configs.key?('rubocop') -%>
rubocop: <%= @configs['rubocop'] %>
<%- end -%>
3 changes: 0 additions & 3 deletions moduleroot/.github/workflows/release.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
tags:
- '*'

env:
BUNDLE_WITHOUT: development:test:system_tests

jobs:
release:
name: Release
Expand Down
36 changes: 18 additions & 18 deletions moduleroot/.gitignore.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

pkg/
Gemfile.lock
Gemfile.local
vendor/
.vendor/
spec/fixtures/manifests/
spec/fixtures/modules/
.vagrant/
.bundle/
.ruby-version
coverage/
log/
.idea/
.dependencies/
.librarian/
Puppetfile.lock
/pkg/
/Gemfile.lock
/Gemfile.local
/vendor/
/.vendor/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/.vagrant/
/.bundle/
/.ruby-version
/coverage/
/log/
/.idea/
/.dependencies/
/.librarian/
/Puppetfile.lock
*.iml
.*.sw?
.yardoc/
Guardfile
/.yardoc/
/Guardfile
<% if ! @configs['paths'].nil? -%>
<% @configs['paths'].each do |path| -%>
<%= path %>
Expand Down
2 changes: 1 addition & 1 deletion moduleroot/.msync.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '5.1.0'
modulesync_config_version: '6.0.0'
64 changes: 32 additions & 32 deletions moduleroot/.pmtignore.erb
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# 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/
Rakefile
.vagrant/
.bundle/
.ruby-version
coverage/
log/
.idea/
.dependencies/
.github/
.librarian/
Puppetfile.lock
/docs/
/pkg/
/Gemfile
/Gemfile.lock
/Gemfile.local
/vendor/
/.vendor/
/spec/
/Rakefile
/.vagrant/
/.bundle/
/.ruby-version
/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
/.editorconfig
/.fixtures.yml
/.gitignore
/.msync.yml
/.overcommit.yml
/.pmtignore
/.rspec
/.rspec_parallel
/.rubocop.yml
/.sync.yml
.*.sw?
.yardoc/
.yardopts
Dockerfile
/.yardoc/
/.yardopts
/Dockerfile
<% if ! @configs['paths'].nil? -%>
<% @configs['paths'].each do |path| -%>
<%= path %>
Expand Down
12 changes: 6 additions & 6 deletions moduleroot/.rubocop.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

<% if File.exist?(File.join(@metadata[:workdir], '.rubocop_todo.yml')) -%>
inherit_from: .rubocop_todo.yml
<% end -%>
inherit_gem:
voxpupuli-test: rubocop.yml

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma

Style/WordArray:
EnforcedStyle: brackets
<% if @configs['extra'] -%>
<%= @configs['extra'].to_yaml.sub(/\A---\n/, '') -%>
<% end -%>
2 changes: 1 addition & 1 deletion moduleroot/Gemfile.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

source ENV['GEM_SOURCE'] || "https://rubygems.org"
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

<% groups = {} -%>
<% (@configs['required'].keys + ((@configs['optional'] || {}).keys)).uniq.each do |key| -%>
Expand Down
39 changes: 7 additions & 32 deletions moduleroot/Rakefile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ end
begin
require 'voxpupuli/release/rake_tasks'
rescue LoadError
# voxpupuli-release not present
else
GCGConfig.user = '<%= @configs['config.user'] || @configs[:namespace] %>'
GCGConfig.project = '<%= @configs['config.project'] || @configs[:puppet_module] %>'
<%- if @configs['config.tag_pattern'] -%>
GCGConfig.tag_pattern = '<%= @configs['config.tag_pattern'] -%>'
<%- end -%>
end
desc "Run main 'test' task and report merged results to coveralls"
Expand All @@ -37,36 +44,4 @@ task test_with_coveralls: [:test] do
end
end

desc 'Generate REFERENCE.md'
task :reference, [:debug, :backtrace] do |t, args|
patterns = '<%= @configs['puppet_strings_patterns'].join(" ") %>'
Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
end

begin
require 'github_changelog_generator/task'
require 'puppet_blacksmith'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
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 = '<%= @configs['config.user'] -%>'
config.project = "puppet-#{metadata.metadata['name'].split('-').last}"
end

# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /linux/
task :changelog do
puts 'Fixing line endings...'
changelog_file = File.join(__dir__, 'CHANGELOG.md')
changelog_txt = File.read(changelog_file)
new_contents = changelog_txt.gsub(%r{\r\n}, "\n")
File.open(changelog_file, "w") {|file| file.puts new_contents }
end
end

rescue LoadError
end
# vim: syntax=ruby
4 changes: 4 additions & 0 deletions moduleroot/spec/spec_helper.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ RSpec.configure do |c|
c.hiera_config = <%= @configs['hiera_config'] %>
end
<%- end -%>
<%- if @configs['add_mocked_facts'] -%>

add_mocked_facts!
<%- end -%>

if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml')))
Expand Down
4 changes: 3 additions & 1 deletion moduleroot/spec/spec_helper_acceptance.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker
<%- unless @configs['configure_beaker'].nil? -%>
configure_beaker(modules: <%= @configs['configure_beaker']['modules'] || ':metadata' %>)

<%- end -%>
Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }

0 comments on commit 6816d67

Please sign in to comment.