forked from jenkins-infra/jenkins-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
34 lines (28 loc) · 1.1 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
require 'puppet-lint/tasks/puppet-lint'
require 'puppetlabs_spec_helper/rake_tasks'
PuppetLint.configuration.send('disable_140chars')
desc "Validate the Puppet syntax of all manifests"
task :validate do
Dir['./{dist,manifests}/**/*.pp'].each do |filename|
sh "puppet parser validate --parser future '#{filename}'"
end
end
PuppetLint::RakeTask.new :lint do |config|
config.disable_checks = ['80chars',
'class_parameter_defaults',
'names_containing_dash']
config.pattern = 'dist/**/*.pp'
config.fail_on_warnings = true
end
desc 'Resolve all the dependencies'
task :resolve do
# Cleanup
`rm -rf ./modules/ .fixtures.yml`
# Generate the test fixtures from the Puppetfile and install them in ./spec/fixtures/ (modules, symlinks, etc.)
`generate-puppetfile -p ./Puppetfile --fixtures-only --ignore-comments`
# Remove jenkins_keys as it is a private repository
`yq --inplace 'del(.fixtures.repositories.jenkins_keys)' .fixtures.yml # Remove jenkins_keys as it is a private repository`
# this fills ./spec/fixtures/modules
Rake::Task['spec_clean'].invoke
Rake::Task['spec_prep'].invoke
end