mirror of
https://github.com/philippdieter/puppet-ldapquery.git
synced 2025-10-13 12:55:48 +00:00
Merge pull request #18 from xaque208/modulesync
Update to module template files
This commit is contained in:
commit
1433c5596d
@ -1 +1 @@
|
|||||||
modulesync_config_version: '2.6.1'
|
modulesync_config_version: '2.9.0'
|
||||||
|
@ -427,9 +427,6 @@ Style/NumericLiterals:
|
|||||||
Style/OneLineConditional:
|
Style/OneLineConditional:
|
||||||
Enabled: True
|
Enabled: True
|
||||||
|
|
||||||
Style/OpMethod:
|
|
||||||
Enabled: True
|
|
||||||
|
|
||||||
Style/ParenthesesAroundCondition:
|
Style/ParenthesesAroundCondition:
|
||||||
Enabled: True
|
Enabled: True
|
||||||
|
|
||||||
|
18
.travis.yml
18
.travis.yml
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
dist: xenial
|
dist: bionic
|
||||||
language: ruby
|
language: ruby
|
||||||
cache: bundler
|
cache: bundler
|
||||||
before_install:
|
before_install:
|
||||||
@ -29,19 +29,3 @@ branches:
|
|||||||
- /^v\d/
|
- /^v\d/
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
irc:
|
|
||||||
on_success: false
|
|
||||||
on_failure: false
|
|
||||||
channels:
|
|
||||||
- "chat.freenode.org#voxpupuli-notifications"
|
|
||||||
deploy:
|
|
||||||
provider: puppetforge
|
|
||||||
user: puppet
|
|
||||||
password:
|
|
||||||
secure: ""
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
# all_branches is required to use tags
|
|
||||||
all_branches: true
|
|
||||||
# Only publish the build marked with "DEPLOY_TO_FORGE"
|
|
||||||
condition: "$DEPLOY_TO_FORGE = yes"
|
|
||||||
|
15
Gemfile
15
Gemfile
@ -11,10 +11,10 @@ def location_for(place, fake_version = nil)
|
|||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
|
gem 'puppetlabs_spec_helper', '>= 2.14.0', :require => false
|
||||||
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
|
gem 'rspec-puppet-facts', '>= 1.9.5', :require => false
|
||||||
gem 'rspec-puppet-utils', :require => false
|
gem 'rspec-puppet-utils', :require => false
|
||||||
gem 'pdk', '>= 1.10.0', :require => false
|
gem 'pdk', :require => false
|
||||||
gem 'puppet-module', :require => false
|
gem 'puppet-module', :require => false
|
||||||
gem 'puppet-lint-leading_zero-check', :require => false
|
gem 'puppet-lint-leading_zero-check', :require => false
|
||||||
gem 'puppet-lint-trailing_comma-check', :require => false
|
gem 'puppet-lint-trailing_comma-check', :require => false
|
||||||
@ -23,6 +23,9 @@ group :test do
|
|||||||
gem 'puppet-lint-unquoted_string-check', :require => false
|
gem 'puppet-lint-unquoted_string-check', :require => false
|
||||||
gem 'puppet-lint-variable_contains_upcase', :require => false
|
gem 'puppet-lint-variable_contains_upcase', :require => false
|
||||||
gem 'puppet-lint-absolute_classname-check', :require => false
|
gem 'puppet-lint-absolute_classname-check', :require => false
|
||||||
|
gem 'puppet-lint-topscope-variable-check', :require => false
|
||||||
|
gem 'puppet-lint-legacy_facts-check', :require => false
|
||||||
|
gem 'puppet-lint-anchor-check', :require => false
|
||||||
gem 'metadata-json-lint', :require => false
|
gem 'metadata-json-lint', :require => false
|
||||||
gem 'redcarpet', :require => false
|
gem 'redcarpet', :require => false
|
||||||
gem 'rubocop', '~> 0.49.1', :require => false
|
gem 'rubocop', '~> 0.49.1', :require => false
|
||||||
@ -64,10 +67,10 @@ group :system_tests do
|
|||||||
end
|
end
|
||||||
|
|
||||||
group :release do
|
group :release do
|
||||||
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
|
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/voxpupuli/github-changelog-generator', :branch => 'voxpupuli_essential_fixes'
|
||||||
gem 'puppet-blacksmith', :require => false
|
gem 'puppet-blacksmith', :require => false
|
||||||
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
|
gem 'voxpupuli-release', :require => false
|
||||||
gem 'puppet-strings', '>= 1.0', :require => false
|
gem 'puppet-strings', '>= 2.2', :require => false
|
||||||
end
|
end
|
||||||
|
|
||||||
group :extra do
|
group :extra do
|
||||||
|
63
Rakefile
63
Rakefile
@ -3,20 +3,12 @@ require 'puppetlabs_spec_helper/rake_tasks'
|
|||||||
# load optional tasks for releases
|
# load optional tasks for releases
|
||||||
# only available if gem group releases is installed
|
# only available if gem group releases is installed
|
||||||
begin
|
begin
|
||||||
require 'puppet_blacksmith/rake_tasks'
|
|
||||||
require 'voxpupuli/release/rake_tasks'
|
require 'voxpupuli/release/rake_tasks'
|
||||||
require 'puppet-strings/tasks'
|
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
|
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
|
||||||
PuppetLint.configuration.fail_on_warnings = true
|
|
||||||
PuppetLint.configuration.absolute_classname_reverse = true
|
PuppetLint.configuration.absolute_classname_reverse = 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(
|
exclude_paths = %w(
|
||||||
pkg/**/*
|
pkg/**/*
|
||||||
@ -29,8 +21,7 @@ PuppetSyntax.exclude_paths = exclude_paths
|
|||||||
|
|
||||||
desc 'Auto-correct puppet-lint offenses'
|
desc 'Auto-correct puppet-lint offenses'
|
||||||
task 'lint:auto_correct' do
|
task 'lint:auto_correct' do
|
||||||
PuppetLint.configuration.fix = true
|
Rake::Task[:lint_fix].invoke
|
||||||
Rake::Task[:lint].invoke
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Run acceptance tests'
|
desc 'Run acceptance tests'
|
||||||
@ -38,10 +29,8 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|
|
|||||||
t.pattern = 'spec/acceptance'
|
t.pattern = 'spec/acceptance'
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Run tests release_checks'
|
desc 'Run tests'
|
||||||
task test: [
|
task test: [:release_checks]
|
||||||
:release_checks,
|
|
||||||
]
|
|
||||||
|
|
||||||
namespace :check do
|
namespace :check do
|
||||||
desc 'Check for trailing whitespace'
|
desc 'Check for trailing whitespace'
|
||||||
@ -70,25 +59,10 @@ task test_with_coveralls: [:test] do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Print supported beaker sets"
|
desc 'Generate REFERENCE.md'
|
||||||
task 'beaker_sets', [:directory] do |t, args|
|
task :reference, [:debug, :backtrace] do |t, args|
|
||||||
directory = args[:directory]
|
patterns = ''
|
||||||
|
Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
|
||||||
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
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -103,16 +77,19 @@ begin
|
|||||||
metadata = JSON.load(File.read(metadata_json))
|
metadata = JSON.load(File.read(metadata_json))
|
||||||
config.project = metadata['name']
|
config.project = metadata['name']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
|
||||||
|
require 'rbconfig'
|
||||||
|
if RbConfig::CONFIG['host_os'] =~ /linux/
|
||||||
|
task :changelog do
|
||||||
|
puts 'Fixing line endings...'
|
||||||
|
changelog_file = File.join(__dir__, 'CHANGELOG.md')
|
||||||
|
changelog_txt = File.read(changelog_file)
|
||||||
|
new_contents = changelog_txt.gsub(%r{\r\n}, "\n")
|
||||||
|
File.open(changelog_file, "w") {|file| file.puts new_contents }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
|
||||||
Blacksmith::RakeTask.new do |t|
|
|
||||||
t.tag_message_pattern = "Version %s"
|
|
||||||
t.tag_pattern = "%s"
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# vim: syntax=ruby
|
# vim: syntax=ruby
|
||||||
|
@ -7,8 +7,14 @@ end
|
|||||||
|
|
||||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||||
require 'rspec-puppet-facts'
|
require 'rspec-puppet-facts'
|
||||||
|
require 'bundler'
|
||||||
include RspecPuppetFacts
|
include RspecPuppetFacts
|
||||||
|
|
||||||
|
if ENV['DEBUG']
|
||||||
|
Puppet::Util::Log.level = :debug
|
||||||
|
Puppet::Util::Log.newdestination(:console)
|
||||||
|
end
|
||||||
|
|
||||||
if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
|
if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
|
||||||
facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml')))
|
facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml')))
|
||||||
if facts
|
if facts
|
||||||
@ -31,10 +37,23 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__))
|
|||||||
add_filter '/spec'
|
add_filter '/spec'
|
||||||
add_filter '/vendor'
|
add_filter '/vendor'
|
||||||
add_filter '/.vendor'
|
add_filter '/.vendor'
|
||||||
|
add_filter Bundler.configured_bundle_path.path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |c|
|
RSpec.configure do |c|
|
||||||
|
# getting the correct facter version is tricky. We use facterdb as a source to mock facts
|
||||||
|
# see https://github.com/camptocamp/facterdb
|
||||||
|
# people might provide a specific facter version. In that case we use it.
|
||||||
|
# Otherwise we need to match the correct facter version to the used puppet version.
|
||||||
|
# as of 2019-10-31, puppet 5 ships facter 3.11 and puppet 6 ships facter 3.14
|
||||||
|
# https://puppet.com/docs/puppet/5.5/about_agent.html
|
||||||
|
c.default_facter_version = if ENV['FACTERDB_FACTS_VERSION']
|
||||||
|
ENV['FACTERDB_FACTS_VERSION']
|
||||||
|
else
|
||||||
|
Gem::Dependency.new('', ENV['PUPPET_VERSION']).match?('', '5') ? '3.11.0' : '3.14.0'
|
||||||
|
end
|
||||||
|
|
||||||
# Coverage generation
|
# Coverage generation
|
||||||
c.after(:suite) do
|
c.after(:suite) do
|
||||||
RSpec::Puppet::Coverage.report!
|
RSpec::Puppet::Coverage.report!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user