Skip to content

Commit

Permalink
Sync with Vox Pupuli
Browse files Browse the repository at this point in the history
In this branch we include what is required to validate this two PRs:

* voxpupuli/modulesync_config#789
  (Synced from this branch)
* voxpupuli/voxpupuli-release#44
  (Fetch the gem form the WIP branch in git rather than Rubygems)
  • Loading branch information
smortex committed Feb 22, 2023
1 parent 4e9cb51 commit 28f34e5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 42 deletions.
22 changes: 17 additions & 5 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
excludes: []
pidfile_workaround: false
additional_packages: ''
acceptance_tests: true
.travis.yml:
delete: true
Jenkinsfile:
Expand All @@ -18,7 +19,7 @@ Gemfile:
- gem: coveralls
- gem: simplecov-console
- gem: puppet_metadata
version: '~> 1.0'
version: '~> 2.0'
':development':
- gem: guard-rake
- gem: overcommit
Expand All @@ -32,12 +33,11 @@ Gemfile:
ruby-version: '2.5'
ruby-operator: '>='
- gem: voxpupuli-release
version: '>= 1.2.0'
- gem: puppet-strings
version: '>= 2.2'
version: '~> 2.0'
Rakefile:
config.user: opus-codium
puppet_strings_patterns: []
# config.project: PROJECT
# config.tag_pattern: 'v%s'
.puppet-lint.rc:
disabled_lint_checks:
- parameter_documentation
Expand All @@ -47,6 +47,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 @@ -75,6 +77,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 Down
12 changes: 7 additions & 5 deletions moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ concurrency:
jobs:
puppet:
name: Puppet
<%- if Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>
<%- if @configs['acceptance_tests'] && Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>
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 -%>
5 changes: 5 additions & 0 deletions moduleroot/.puppet-lint.rc.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--fail-on-warnings
<% checks = @configs['disabled_lint_checks'] - @configs['enabled_lint_checks'] -%>
<% checks.each do |check| -%>
--no-<%= check.sub(/^disable_/, '') %>-check
<% end -%>
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 = metadata.metadata['name']
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

0 comments on commit 28f34e5

Please sign in to comment.