summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-10 14:48:26 -0400
committerMicah <micah@leap.se>2016-05-10 14:48:26 -0400
commit86c85582065c391aa13c0b9b397dfd1aa2e2ac7b (patch)
tree7c027409a517d862864bf3650f4a8a66f615162d /Rakefile
parent70b1c648b94e6c007b9241a4661f33881e74485f (diff)
parent66b4c6b5ec6fe2f242020845fe92715ae2cdcc1e (diff)
Merge tag '0.8.0'
Release 0.8.0
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 00000000..8f7a9686
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,47 @@
+require 'puppetlabs_spec_helper/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+require 'puppet-syntax/tasks/puppet-syntax'
+
+# return list of modules, either
+# submodules or custom modules
+# so we can check each array seperately
+def modules_pattern (type)
+ submodules = Array.new
+ custom_modules = Array.new
+
+ Dir['puppet/modules/*'].sort.each do |m|
+ system("grep -q #{m} .gitmodules")
+ if $?.exitstatus == 0
+ submodules << m + '/**/*.pp'
+ else
+ custom_modules << m + '/**/*.pp'
+ end
+ end
+
+ if type == 'submodule'
+ submodules
+ elsif type == 'custom'
+ custom_modules
+ else
+ end
+
+end
+
+
+
+# redefine lint task with specific configuration
+Rake::Task[:lint].clear
+desc "boo"
+PuppetLint::RakeTask.new :lint do |config|
+ # Pattern of files to check, defaults to `**/*.pp`
+ config.pattern = modules_pattern('custom')
+ config.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
+ config.disable_checks = ['documentation', '80chars']
+ config.fail_on_warnings = false
+end
+
+# rake syntax::* tasks
+PuppetSyntax.exclude_paths = ["**/vendor/**/*"]
+
+desc "Run all puppet checks required for CI"
+task :test => [:lint, :syntax , :validate, :spec]