Commit a966a779 authored by Ben S's avatar Ben S Committed by GitHub

Merge pull request #878 from bastelfreak/gemfile

partial modulesync: switch to Gemfile/Rakefile from modulesync1.9.3
parents 0b8b6f5b c7d0979d
......@@ -8,28 +8,28 @@ env:
matrix:
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
bundler_args: --without system_tests release
env: PUPPET_VERSION="~> 4.0" CHECK=test_with_coveralls PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without system_tests development release
bundler_args: --without system_tests release
env: PUPPET_VERSION="~> 4.0" CHECK=rubocop
- rvm: 2.4.3
bundler_args: --without system_tests development release
bundler_args: --without system_tests release
env: PUPPET_VERSION="~> 4.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.4.3
bundler_args: --without development release
bundler_args: --without release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04 CHECK=beaker
services: docker
sudo: required
- rvm: 2.4.3
bundler_args: --without development release
bundler_args: --without release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker
services: docker
sudo: required
- rvm: 2.4.3
bundler_args: --without development release
bundler_args: --without release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker
services: docker
......
source 'https://rubygems.org'
gem 'json', :require => false
gem 'metadata-json-lint', :require => false
gem 'parallel_tests', :require => false
gem 'puppet-lint', '~> 2.0', :require => false
gem 'puppet-strings', :require => false
gem 'puppet-syntax', '~> 2.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2', :require => false
gem 'rake', '>= 10.1.1', :require => false
gem 'retries', '~> 0.0.5', :require => false
gem 'rspec-its', :require => false
gem 'rspec-puppet', '~> 2.5.0', :require => false
gem 'rubocop', '~> 0.49.1', :require => false
gem 'rubocop-rspec', '~> 1.15.0', :require => false
gem 'travis', '~> 1.8', :require => false
gem 'rspec-puppet-facts'
source ENV['GEM_SOURCE'] || "https://rubygems.org"
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
group :test do
gem 'puppetlabs_spec_helper', '~> 2.6', :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.4.0', :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
gem 'retries', :require => false
gem 'rspec-its', :require => false
end
group :development do
gem 'byebug'
gem 'ci_reporter'
gem 'pry'
gem 'pry-byebug'
gem 'simplecov'
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 'beaker-puppet_install_helper', :require => false
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
gem 'vagrant-wrapper', :require => false
gem 'beaker'
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-hostgenerator', '>= 1.1.10', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
end
group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator' 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
......
require 'puppetlabs_spec_helper/rake_tasks'
require 'rubocop/rake_task'
require 'puppet-strings/tasks'
RuboCop::RakeTask.new
# 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
exclude_paths = [
'pkg/**/*',
'vendor/**/*',
'spec/**/*',
'examples/**/*'
]
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')
# Make sure we don't have the default rake task floating around
Rake::Task['lint'].clear
exclude_paths = %w(
pkg/**/*
vendor/**/*
.vendor/**/*
spec/**/*
)
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
PuppetLint.configuration.relative = true
PuppetLint::RakeTask.new(:lint) do |l|
l.disable_checks = %w(80chars class_inherits_from_params_class)
l.ignore_paths = exclude_paths
l.fail_on_warnings = true
l.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
PuppetLint.configuration.fix = true
Rake::Task[:lint].invoke
end
PuppetSyntax.exclude_paths = exclude_paths
desc 'Run acceptance tests'
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
namespace :travis do
desc 'Syntax check travis.yml'
task :lint do
# warnings are currently non-fatal due to suspected problems with
# validation of matrix::include
#sh "travis lint --exit-code" do |ok, res|
sh 'travis lint --skip-completion-check' do |ok, res|
unless ok
# exit without verbose rake error message
exit res.exitstatus
end
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
end
sh_scripts = %w(
templates/jenkins-slave-run.erb
)
desc 'Syntax check shellscripts'
task :shellcheck do
sh "shellcheck #{sh_scripts.join(' ')}" do |ok, res|
unless ok
# exit without verbose rake error message
exit res.exitstatus
desc "Print supported beaker sets"
task 'beaker_sets', [:directory] do |t, args|
directory = args[:directory]
metadata = JSON.load(File.read('metadata.json'))
(metadata['operatingsystem_support'] || []).each do |os|
(os['operatingsystemrelease'] || []).each do |release|
if directory
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
else
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
end
filename = "spec/acceptance/nodesets/#{beaker_set}.yml"
puts beaker_set if File.exists? filename
end
end
end
default_tasks = [
:lint,
:validate,
:parallel_spec,
:rubocop
]
task :default => default_tasks
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment