From 98e7a7695423184b4e7b6b858087544b44beffa0 Mon Sep 17 00:00:00 2001 From: Merritt Krakowitzer Date: Sat, 21 Feb 2015 00:16:20 +0200 Subject: [PATCH] Commit meta files in preparation for version 2 --- .fixtures.yml | 2 +- .gitignore | 2 ++ .travis.yml | 27 ++++++++++++++++++----- Gemfile | 14 +++++++----- Guardfile | 4 ++++ Rakefile | 61 ++++++++++++++++++++++++++++++++++++++------------- metadata.json | 15 ++++++------- 7 files changed, 89 insertions(+), 36 deletions(-) create mode 100644 Guardfile diff --git a/.fixtures.yml b/.fixtures.yml index 4173d7f..a0023fa 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,5 +3,5 @@ fixtures: confluence: "#{source_dir}" repositories: deploy: "http://github.com/mkrakowitzer/puppet-deploy" - staging: "https://github.com/nanliu/puppet-staging" + staging: "http://github.com/nanliu/puppet-staging" stdlib: "http://github.com/puppetlabs/puppetlabs-stdlib.git" diff --git a/.gitignore b/.gitignore index 2db4a16..86ccb0e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ pkg/ *.project spec/fixtures/modules Gemfile.lock +.vagrant +log diff --git a/.travis.yml b/.travis.yml index ea03f85..1bf31c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,29 @@ --- language: ruby -bundler_args: --without system_tests -script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" +bundler_args: --without development system_tests +before_install: rm Gemfile.lock || true +rvm: + - 1.8.7 + - 1.9.3 + - 2.0.0 + - 2.1.0 +script: bundle exec rake test +env: + - PUPPET_VERSION="~> 3.2.0" + - PUPPET_VERSION="~> 3.3.0" + - PUPPET_VERSION="~> 3.4.0" + - PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes matrix: - fast_finish: true - include: + exclude: - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" + env: PUPPET_VERSION="~> 2.7.0" - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.0" + env: PUPPET_VERSION="~> 2.7.0" + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 2.7.0" notifications: email: - merritt@krakowitzer.com diff --git a/Gemfile b/Gemfile index 3c949d2..1751213 100644 --- a/Gemfile +++ b/Gemfile @@ -4,16 +4,18 @@ if ENV.key?('PUPPET_VERSION') else puppetversion = ['>= 3.4.2'] end -rspecversion = ENV.key?('RSPEC_VERSION') ? "= #{ENV['RSPEC_VERSION']}" : ['>= 2.14 ', '< 3.0.0'] gem 'rake' gem 'puppet-lint' -gem 'rspec', rspecversion -gem 'rspec-puppet', "1.0.1" +gem 'rspec' +gem 'rspec-puppet', "~> 2" gem 'puppetlabs_spec_helper' gem 'puppet', puppetversion gem 'puppet-blacksmith' gem 'beaker' gem 'pry' -gem 'serverspec', "~> 1.0" -gem 'beaker-rspec', "~> 2.2.4",:require => false -gem 'minitest', "~> 4" +gem 'serverspec' +gem 'beaker-rspec' +gem 'minitest' +gem 'guard-rake' +gem "metadata-json-lint" +gem "rspec-puppet-facts" diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..9f238e0 --- /dev/null +++ b/Guardfile @@ -0,0 +1,4 @@ +notification :off +guard 'rake', :task => 'test' do + watch(%r{^manifests\/(.+)\.pp$}) +end diff --git a/Rakefile b/Rakefile index 7bb1a7d..ea3b9c9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,50 @@ -require 'rake' require 'puppetlabs_spec_helper/rake_tasks' -require 'rspec/core/rake_task' -require 'puppet_blacksmith/rake_tasks' - -LINT_IGNORES = ['rvm'] +require 'puppet/vendor/semantic/lib/semantic' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' +# These gems aren't always present, for instance +# on Travis with --without development begin - if Gem::Specification::find_by_name('puppet-lint') - require 'puppet-lint/tasks/puppet-lint' - PuppetLint.configuration.fail_on_warnings = true, - PuppetLint.configuration.send('disable_80chars') - PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp", "pkg/**/**/*.pp"] - PuppetLint.configuration.log_format = - '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}' - task :default => [:spec,:syntax,:validate,:lint] - end -rescue Gem::LoadError + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +Rake::Task[:lint].clear + +PuppetLint.configuration.relative = true +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" +PuppetLint.configuration.fail_on_warnings = true + +# Forsake support for Puppet 2.6.2 for the benefit of cleaner code. +# http://puppet-lint.com/checks/class_parameter_defaults/ +PuppetLint.configuration.send('disable_class_parameter_defaults') +# http://puppet-lint.com/checks/class_inherits_from_params_class/ +PuppetLint.configuration.send('disable_class_inherits_from_params_class') + +exclude_paths = [ + "bundle/**/*", + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +desc "Run acceptance tests" +RSpec::Core::RakeTask.new(:acceptance) do |t| + t.pattern = 'spec/acceptance' end + +task :metadata do + sh "metadata-json-lint metadata.json" +end + +desc "Run syntax, lint, and spec tests." +task :test => [ + :syntax, + :lint, + :spec, + :metadata, +] diff --git a/metadata.json b/metadata.json index ffb171f..92e13bf 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "mkrakowitzer-confluence", - "version": "1.0.1", + "version": "2.0.0", "author": "mkrakowitzer", "summary": "Install atlassian confluence", "license": "MIT", @@ -17,10 +17,6 @@ "name": "mkrakowitzer/deploy", "version_requirement": ">= 0.0.3" }, - { - "name": "yguenane/repoforge", - "version_requirement": ">= 0.2.0" - }, { "name": "nanliu/staging", "version_requirement": ">= 1.0.0" @@ -40,19 +36,22 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "6" + "6", + "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "6" + "6", + "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "12.04" + "12.04", + "14.04" ] }, {