diff --git a/.travis.yml b/.travis.yml index 81e9a95..868419f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,19 @@ sudo: false language: ruby -bundler_args: --without beaker +bundler_args: --without release beaker rvm: - - 2.0 - - 2.1 - - 2.2 + - '2.0' + - '2.1' + - '2.2' env: - PUPPET_GEM_VERSION="~> 3.7" - - PUPPET_GEM_VERSION="~> 4.0" + - PUPPET_GEM_VERSION="~> 4.9" matrix: exclude: - - rvm: 2.2 + - rvm: '2.2' env: PUPPET_GEM_VERSION="~> 3.7" + - rvm: '2.0' + env: PUPPET_GEM_VERSION="~> 4.9" fast_finish: true notifications: email: false diff --git a/Gemfile b/Gemfile index 8576981..ee6fa0b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,35 +1,22 @@ source 'https://rubygems.org' -if puppetversion = ENV['PUPPET_GEM_VERSION'] - gem 'puppet', puppetversion, :require => false -else - gem 'puppet', :require => false -end - -if facterversion = ENV['FACTER_GEM_VERSION'] - gem 'facter', facterversion, :require => false -else - gem 'facter', :require => false -end +gem 'metadata-json-lint', :require => false +gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 4.9', :require => false +gem 'puppetlabs_spec_helper', '~> 1.2', :require => false +gem 'puppet-lint', '~> 2.0', :require => false +gem 'puppet-syntax', :require => false +gem 'rake', :require => false +gem 'rspec-puppet', '~> 2.5.0', :require => false +gem 'travis', '~> 1.8', :require => false -group :development, :test do - gem 'rake', :require => false - # https://github.com/rspec/rspec-core/issues/1864 - gem 'rspec', '< 3.2.0', {"platforms"=>["ruby_18"]} - gem 'puppetlabs_spec_helper', :require => false - gem 'puppet-lint', '>= 1.1.0', :require => false - gem 'puppet-syntax', :require => false - gem 'rspec-puppet', '~> 2.1.0', :require => false - gem 'metadata-json-lint', :require => false +group :release do + gem 'puppet-blacksmith', :require => false end group :beaker do - gem 'serverspec', :require => false - gem 'beaker', '<= 2.26.0', :require => false - gem 'beaker-rspec', :require => false - gem 'pry', :require => false - gem 'travis-lint', :require => false - gem 'puppet-blacksmith', :require => false + gem 'beaker-puppet_install_helper', :require => false + gem 'beaker-rspec', '~> 6.0.0', :require => false + gem 'serverspec', :require => false end # vim:ft=ruby diff --git a/Rakefile b/Rakefile index eb6ac09..bbeb353 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,4 @@ require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-syntax/tasks/puppet-syntax' -require 'puppet-lint/tasks/puppet-lint' begin require 'puppet_blacksmith/rake_tasks' @@ -17,8 +15,16 @@ PuppetLint::RakeTask.new :lint do |config| config.fail_on_warnings = true end -task :travis_lint do - sh "travis-lint" +namespace :travis do + desc 'Syntax check travis.yml' + task :lint do + sh "travis lint --exit-code --skip-completion-check" do |ok, res| + unless ok + # exit without verbose rake error message + exit res.exitstatus + end + end + end end task :default => [