forked from graylog-labs/graylog2-puppet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
35 lines (30 loc) · 1.18 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
require 'rake'
require 'rspec/core/rake_task'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet_blacksmith/rake_tasks'
require 'puppetlabs_spec_helper/rake_tasks'
PuppetLint.configuration.relative = true
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_class_parameter_defaults')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_arrow_alignment')
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
exclude_paths = [
"modules/**/*",
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
task :default => [:syntax, :lint, :spec]
task :build => :default do
# There is no way to exclude files with the module tools. So we need this
# gross hack.
sh "rm -rf build && git clone $PWD build"
sh "cd build && rm -rf development Gemfile Vagrantfile"
sh "cd build && bundle exec puppet module build $PWD"
sh "mkdir -p pkg && mv build/pkg/*.gz pkg/ && rm -rf build"
end