Update from xaque208 modulesync_config

This commit is contained in:
Zach Leslie
2019-12-22 21:33:39 -08:00
parent f43e6918cf
commit 1c133dd430
6 changed files with 50 additions and 70 deletions

View File

@@ -3,20 +3,12 @@ require 'puppetlabs_spec_helper/rake_tasks'
# load optional tasks for releases
# only available if gem group releases is installed
begin
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks'
rescue LoadError
end
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.absolute_classname_reverse = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
exclude_paths = %w(
pkg/**/*
@@ -29,8 +21,7 @@ PuppetSyntax.exclude_paths = exclude_paths
desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
PuppetLint.configuration.fix = true
Rake::Task[:lint].invoke
Rake::Task[:lint_fix].invoke
end
desc 'Run acceptance tests'
@@ -38,10 +29,8 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
desc 'Run tests release_checks'
task test: [
:release_checks,
]
desc 'Run tests'
task test: [:release_checks]
namespace :check do
desc 'Check for trailing whitespace'
@@ -70,25 +59,10 @@ task test_with_coveralls: [:test] do
end
end
desc "Print supported beaker sets"
task 'beaker_sets', [:directory] do |t, args|
directory = args[:directory]
metadata = JSON.load(File.read('metadata.json'))
(metadata['operatingsystem_support'] || []).each do |os|
(os['operatingsystemrelease'] || []).each do |release|
if directory
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
else
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
end
filename = "spec/acceptance/nodesets/#{beaker_set}.yml"
puts beaker_set if File.exists? filename
end
end
desc 'Generate REFERENCE.md'
task :reference, [:debug, :backtrace] do |t, args|
patterns = ''
Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
end
begin
@@ -103,16 +77,19 @@ begin
metadata = JSON.load(File.read(metadata_json))
config.project = 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
begin
Blacksmith::RakeTask.new do |t|
t.tag_message_pattern = "Version %s"
t.tag_pattern = "%s"
end
rescue
end
# vim: syntax=ruby