-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRakefile
55 lines (49 loc) · 1.55 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
require 'bundler/gem_tasks'
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'ci/reporter/rake/rspec'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp']
desc 'Prep CI RSpec tests'
task :ci_prep do
require 'rubygems'
begin
gem 'ci_reporter'
require 'ci/reporter/rake/rspec'
ENV['CI_REPORTS'] = 'results'
rescue LoadError
puts 'Missing ci_reporter gem. You must have the ci_reporter gem ' \
'installed to run the CI spec tests'
end
end
desc 'Run the CI RSpec tests'
task ci_spec: [:ci_prep, 'ci:setup:rspec', :spec]
desc 'Validate manifests, templates, and ruby files'
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file|
sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec\/fixtures}
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end
desc 'Generate typedoc.rst for the guide'
task :typedoc do
system 'puppet doc -r type \
| awk \'/This page/{flag=1}/augeas/{flag=0}/eos_/{flag=1}/ exec/\
{flag=0}/\*This page/{flag=1}flag\' \
| pandoc --from=markdown --to=rst --output=- \
> guide/typedoc.rst'
end
desc 'Generate Getting Started Guide HTML'
task guide: [:typedoc] do
system 'make -C guide html'
end
desc 'Clean Getting Started docs'
task :guide_clean do
system 'make -C guide clean'
end