Add checks to rake validate and update Travis

This commit is contained in:
Garrett Honeycutt 2013-12-19 07:49:32 -05:00
parent 7c378d0e8b
commit 96d38fb876
2 changed files with 11 additions and 5 deletions

View File

@ -1,7 +1,7 @@
---
env:
- PUPPET_VERSION=2.7.23
- PUPPET_VERSION=3.2.4
- PUPPET_VERSION=3.3.2
notifications:
email: false
rvm:

View File

@ -2,11 +2,17 @@ require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp"]
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
desc "Run puppet in noop mode and check for syntax errors."
task :validate do
Dir['manifests/**/*.pp'].each do |path|
sh "puppet parser validate --noop #{path}"
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 =~ /spec\/fixtures/
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end