This repository has been archived by the owner on Oct 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3b9417
commit 81e7731
Showing
3 changed files
with
145 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
--- | ||
sudo: false | ||
dist: trusty | ||
language: ruby | ||
bundler_args: --without development | ||
script: "bundle exec rake validate && bundle exec rake spec SPEC_OPTS='--format documentation'" | ||
cache: bundler | ||
before_install: | ||
- bundle -v | ||
- rm Gemfile.lock || true | ||
- gem update --system | ||
- gem update bundler | ||
- gem --version | ||
- bundle -v | ||
script: | ||
- bundle exec rake $CHECK | ||
matrix: | ||
fast_finish: true | ||
include: | ||
- rvm: 1.8.7 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 1.9.3 | ||
env: PUPPET_GEM_VERSION="~> 3.4.0" | ||
- rvm: 1.9.3 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 1.9.3 | ||
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" | ||
- rvm: 1.9.3 | ||
env: PUPPET_GEM_VERSION="~> 4.0" | ||
- rvm: 2.0.0 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 2.0.0 | ||
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" | ||
- rvm: 2.0.0 | ||
env: PUPPET_GEM_VERSION="~> 4.0" | ||
- rvm: 2.1.5 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 2.1.5 | ||
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" | ||
- rvm: 2.1.5 | ||
env: PUPPET_GEM_VERSION="~> 4.0" | ||
notifications: | ||
email: false | ||
- rvm: 2.4.2 | ||
bundler_args: --without system_tests development release | ||
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,77 @@ | ||
source ENV['GEM_SOURCE'] || "https://rubygems.org" | ||
|
||
# https://github.com/rspec/rspec-core/issues/1864 | ||
gem 'rspec', '~> 3.1.0' | ||
gem 'puppetlabs_spec_helper', '>= 0.1.0' | ||
gem 'puppet-lint', '>= 0.3.2' | ||
|
||
if RUBY_VERSION != '1.8.7' | ||
gem 'beaker-rspec', :require => false | ||
gem 'pry', :require => false | ||
def location_for(place, fake_version = nil) | ||
if place =~ /^(git[:@][^#]*)#(.*)/ | ||
[fake_version, { :git => $1, :branch => $2, :require => false }].compact | ||
elsif place =~ /^file:\/\/(.*)/ | ||
['>= 0', { :path => File.expand_path($1), :require => false }] | ||
else | ||
[place, { :require => false }] | ||
end | ||
end | ||
|
||
if facterversion = ENV['FACTER_GEM_VERSION'] | ||
gem 'facter', facterversion, :require => false | ||
else | ||
gem 'facter', :require => false | ||
group :test do | ||
gem 'puppetlabs_spec_helper', '~> 2.5.0', :require => false | ||
gem 'rspec-puppet', '~> 2.5', :require => false | ||
gem 'rspec-puppet-facts', :require => false | ||
gem 'rspec-puppet-utils', :require => false | ||
gem 'puppet-lint-leading_zero-check', :require => false | ||
gem 'puppet-lint-trailing_comma-check', :require => false | ||
gem 'puppet-lint-version_comparison-check', :require => false | ||
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false | ||
gem 'puppet-lint-unquoted_string-check', :require => false | ||
gem 'puppet-lint-variable_contains_upcase', :require => false | ||
gem 'metadata-json-lint', :require => false | ||
gem 'redcarpet', :require => false | ||
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0' | ||
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0' | ||
gem 'mocha', '>= 1.2.1', :require => false | ||
gem 'coveralls', :require => false | ||
gem 'simplecov-console', :require => false | ||
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2' | ||
gem 'parallel_tests', :require => false | ||
end | ||
|
||
group :development do | ||
gem 'travis', :require => false | ||
gem 'travis-lint', :require => false | ||
gem 'guard-rake', :require => false | ||
gem 'overcommit', '>= 0.39.1', :require => false | ||
end | ||
|
||
group :system_tests do | ||
gem 'winrm', :require => false | ||
if beaker_version = ENV['BEAKER_VERSION'] | ||
gem 'beaker', *location_for(beaker_version) | ||
else | ||
gem 'beaker', '>= 3.9.0', :require => false | ||
end | ||
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION'] | ||
gem 'beaker-rspec', *location_for(beaker_rspec_version) | ||
else | ||
gem 'beaker-rspec', :require => false | ||
end | ||
gem 'serverspec', :require => false | ||
gem 'beaker-puppet_install_helper', :require => false | ||
gem 'beaker-module_install_helper', :require => false | ||
end | ||
|
||
if puppetversion = ENV['PUPPET_GEM_VERSION'] | ||
gem 'puppet', puppetversion, :require => false | ||
group :release do | ||
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2' | ||
gem 'puppet-blacksmith', :require => false | ||
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem' | ||
gem 'puppet-strings', '~> 1.0', :require => false | ||
end | ||
|
||
|
||
|
||
if facterversion = ENV['FACTER_GEM_VERSION'] | ||
gem 'facter', facterversion.to_s, :require => false, :groups => [:test] | ||
else | ||
gem 'puppet', :require => false | ||
gem 'facter', :require => false, :groups => [:test] | ||
end | ||
|
||
# vim:ft=ruby | ||
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s | ||
gem 'puppet', puppetversion, :require => false, :groups => [:test] | ||
|
||
# vim: syntax=ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,66 @@ | ||
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", "pkg/**/*.pp"] | ||
|
||
desc "Validate manifests, templates, and ruby files" | ||
task :validate do | ||
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/ | ||
|
||
# load optional tasks for releases | ||
# only available if gem group releases is installed | ||
begin | ||
require 'puppet_blacksmith/rake_tasks' | ||
require 'voxpupuli/release/rake_tasks' | ||
require 'puppet-strings/tasks' | ||
rescue LoadError | ||
end | ||
|
||
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}' | ||
PuppetLint.configuration.fail_on_warnings = true | ||
PuppetLint.configuration.send('relative') | ||
PuppetLint.configuration.send('disable_140chars') | ||
PuppetLint.configuration.send('disable_class_inherits_from_params_class') | ||
PuppetLint.configuration.send('disable_documentation') | ||
PuppetLint.configuration.send('disable_single_quote_string_with_variables') | ||
|
||
exclude_paths = %w( | ||
pkg/**/* | ||
vendor/**/* | ||
.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 | ||
|
||
desc 'Run tests metadata_lint, release_checks' | ||
task test: [ | ||
:metadata_lint, | ||
:release_checks, | ||
] | ||
|
||
desc "Run main 'test' task and report merged results to coveralls" | ||
task test_with_coveralls: [:test] do | ||
if Dir.exist?(File.expand_path('../lib', __FILE__)) | ||
require 'coveralls/rake/task' | ||
Coveralls::RakeTask.new | ||
Rake::Task['coveralls:push'].invoke | ||
else | ||
puts 'Skipping reporting to coveralls. Module has no lib dir' | ||
end | ||
Dir['templates/**/*.erb'].each do |template| | ||
sh "erb -P -x -T '-' #{template} | ruby -c" | ||
end | ||
|
||
begin | ||
require 'github_changelog_generator/task' | ||
GitHubChangelogGenerator::RakeTask.new :changelog do |config| | ||
version = (Blacksmith::Modulefile.new).version | ||
config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/ | ||
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." | ||
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} | ||
config.user = 'voxpupuli' | ||
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json') | ||
metadata = JSON.load(File.read(metadata_json)) | ||
config.project = metadata['name'] | ||
end | ||
rescue LoadError | ||
end | ||
# vim: syntax=ruby | ||
|