-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
80 lines (69 loc) · 1.88 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# frozen_string_literal: true
task default: %w[
check:symlinks
check:git_ignore
check:dot_underscore
check:test_file
rubocop
syntax
lint
metadata_lint
r10k:check
r10k:install
parallel_spec
]
# Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper),
# otherwise attempt to load it directly.
# rubocop:disable Lint/SuppressedException
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
begin
require 'voxpupuli/release/rake_tasks'
rescue LoadError
end
# rubocop:enable Lint/SuppressedException
desc "Run main 'test' task and report merged results to coveralls"
task test_with_coveralls: [:test] do
if Dir.exist?(File.expand_path('lib', __dir__))
require 'coveralls/rake/task'
Coveralls::RakeTask.new
Rake::Task['coveralls:push'].invoke
else
puts 'Skipping reporting to coveralls. Module has no lib dir'
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
PuppetLint::RakeTask.new :lint do |config|
config.fail_on_warnings = true
end
PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.send('disable_manifest_whitespace_closing_bracket_after')
namespace :r10k do
desc 'Create puppet module fixtures using r10k'
task :install do
sh("r10k puppetfile install --verbose --moduledir=#{Dir.pwd}/spec/fixtures/modules")
end
desc 'Check Puppetfile using r10k'
task :check do
sh('r10k puppetfile check --verbose')
end
end
# vim: syntax=ruby