diff --git a/.travis.yml b/.travis.yml index e019b3dc..97506702 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,16 @@ -language: ruby -before_script: "gem install --no-ri --no-rdoc bundler" -after_script: -script: 'SPEC_OPTS="--format documentation" bundle exec rake spec' +--- +env: +- PUPPET_VERSION=2.7.23 +- PUPPET_VERSION=3.2.4 notifications: - email: false +email: false rvm: - - 1.9.3 - - 1.8.7 -env: - - PUPPET_VERSION=2.7.13 - - PUPPET_VERSION=3.2.1 +- 1.9.3 +- 1.8.7 +matrix: + allow_failures: + - env: PUPPET_VERSION=2.7.23 +language: ruby +before_script: "gem install --no-ri --no-rdoc bundler" +script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec' gemfile: Gemfile diff --git a/Gemfile b/Gemfile index 6e86a9f1..b40b4c08 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ -source :rubygems +source "https://rubygems.org" puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] gem 'puppet', puppetversion gem 'puppetlabs_spec_helper', '>= 0.1.0' gem 'puppet-lint', '>= 0.3.2' +gem 'facter', '>= 1.7.0', "< 1.8.0" diff --git a/Rakefile b/Rakefile index 22eae901..55b411f9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,12 @@ 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"] + +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}" + end +end