1 require 'puppetlabs_spec_helper/rake_tasks'
3 # load optional tasks for releases
4 # only available if gem group releases is installed
6 require 'puppet_blacksmith/rake_tasks'
7 require 'voxpupuli/release/rake_tasks'
8 require 'puppet-strings/tasks'
12 PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
13 PuppetLint.configuration.fail_on_warnings = true
14 PuppetLint.configuration.send('relative')
15 PuppetLint.configuration.send('disable_140chars')
16 PuppetLint.configuration.send('disable_class_inherits_from_params_class')
17 PuppetLint.configuration.send('disable_documentation')
18 PuppetLint.configuration.send('disable_single_quote_string_with_variables')
26 PuppetLint.configuration.ignore_paths = exclude_paths
27 PuppetSyntax.exclude_paths = exclude_paths
29 desc 'Auto-correct puppet-lint offenses'
30 task 'lint:auto_correct' do
31 PuppetLint.configuration.fix = true
32 Rake::Task[:lint].invoke
35 desc 'Run acceptance tests'
36 RSpec::Core::RakeTask.new(:acceptance) do |t|
37 t.pattern = 'spec/acceptance'
40 desc 'Run tests metadata_lint, release_checks'
46 desc "Run main 'test' task and report merged results to coveralls"
47 task test_with_coveralls: [:test] do
48 if Dir.exist?(File.expand_path('../lib', __FILE__))
49 require 'coveralls/rake/task'
50 Coveralls::RakeTask.new
51 Rake::Task['coveralls:push'].invoke
53 puts 'Skipping reporting to coveralls. Module has no lib dir'
57 desc "Print supported beaker sets"
58 task 'beaker_sets', [:directory] do |t, args|
59 directory = args[:directory]
61 metadata = JSON.load(File.read('metadata.json'))
63 (metadata['operatingsystem_support'] || []).each do |os|
64 (os['operatingsystemrelease'] || []).each do |release|
66 beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
68 beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
71 filename = "spec/acceptance/nodesets/#{beaker_set}.yml"
73 puts beaker_set if File.exists? filename
79 require 'github_changelog_generator/task'
80 GitHubChangelogGenerator::RakeTask.new :changelog do |config|
81 version = (Blacksmith::Modulefile.new).version
82 config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/
83 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."
84 config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
85 config.user = 'voxpupuli'
86 metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
87 metadata = JSON.load(File.read(metadata_json))
88 config.project = metadata['name']