diff --git a/.gitignore b/.gitignore index 650022e..88cf7a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,26 @@ .git/ .*.sw[op] .metadata .yardoc .yardwarns *.iml /.bundle/ /.idea/ /.vagrant/ /coverage/ /bin/ /doc/ /Gemfile.local /Gemfile.lock /junit/ /log/ /pkg/ /spec/fixtures/manifests/ /spec/fixtures/modules/ /tmp/ /vendor/ /convert_report.txt /update_report.txt .DS_Store +.vscode/ +.envrc diff --git a/.pdkignore b/.pdkignore index b713b3b..2ec773a 100644 --- a/.pdkignore +++ b/.pdkignore @@ -1,37 +1,39 @@ .git/ .*.sw[op] .metadata .yardoc .yardwarns *.iml /.bundle/ /.idea/ /.vagrant/ /coverage/ /bin/ /doc/ /Gemfile.local /Gemfile.lock /junit/ /log/ /pkg/ /spec/fixtures/manifests/ /spec/fixtures/modules/ /tmp/ /vendor/ /convert_report.txt /update_report.txt .DS_Store +.vscode/ +.envrc /appveyor.yml /.fixtures.yml /Gemfile /.gitattributes /.gitignore /.gitlab-ci.yml /.pdkignore /Rakefile /.rspec /.rubocop.yml /.travis.yml /.yardopts /spec/ diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece..e69de29 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +0,0 @@ ---relative diff --git a/.sync.yml b/.sync.yml index b4dd4f5..48ecd5d 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,37 +1,41 @@ --- +.gitignore: + required: + - ---.project + .gitlab-ci.yml: unmanaged: true .travis.yml: docker_sets: - set: docker/centos-7 - set: docker/ubuntu-14.04 docker_defaults: bundler_args: "" secure: "" branches: - release appveyor.yml: delete: true Gemfile: required: ':system_tests': - gem: 'puppet-module-posix-system-r#{minor_version}' platforms: ruby - gem: 'puppet-module-win-system-r#{minor_version}' platforms: - mswin - mingw - x64_mingw optional: ':development': - gem: 'github_changelog_generator' git: 'https://github.com/skywinder/github-changelog-generator' ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')" spec/spec_helper.rb: mock_with: ':rspec' coverage_report: true diff --git a/Rakefile b/Rakefile index a6b14c5..750ef46 100755 --- a/Rakefile +++ b/Rakefile @@ -1,76 +1,76 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" returnVal = nil || JSON.load(File.read('metadata.json'))['author'] raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? puts "GitHubChangelogGenerator user:#{returnVal}" returnVal end def changelog_project return unless Rake.application.top_level_tasks.include? "changelog" returnVal = nil || JSON.load(File.read('metadata.json'))['name'] raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil? puts "GitHubChangelogGenerator project:#{returnVal}" returnVal end def changelog_future_release return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = JSON.load(File.read('metadata.json'))['version'] + returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version'] raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? puts "GitHubChangelogGenerator future_release:#{returnVal}" returnVal end PuppetLint.configuration.send('disable_relative') if Bundler.rubygems.find_name('github_changelog_generator').any? GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" config.project = "#{changelog_project}" config.future_release = "#{changelog_future_release}" config.exclude_labels = ['maintenance'] config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)." config.add_pr_wo_labels = true config.issues = false config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM" config.configure_sections = { "Changed" => { "prefix" => "### Changed", "labels" => ["backwards-incompatible"], }, "Added" => { "prefix" => "### Added", "labels" => ["feature", "enhancement"], }, "Fixed" => { "prefix" => "### Fixed", "labels" => ["bugfix"], }, } end else desc 'Generate a Changelog from GitHub' task :changelog do raise <= Gem::Version.new('2.2.2')" EOM end end diff --git a/metadata.json b/metadata.json index 4f99f56..81af762 100644 --- a/metadata.json +++ b/metadata.json @@ -1,78 +1,78 @@ { "name": "puppetlabs-vcsrepo", "version": "2.4.0", "author": "puppetlabs", "summary": "Puppet module providing a type to manage repositories from various version control systems", "license": "GPL-2.0+", "source": "https://github.com/puppetlabs/puppetlabs-vcsrepo", "project_page": "https://github.com/puppetlabs/puppetlabs-vcsrepo", "issues_url": "https://tickets.puppetlabs.com/browse/MODULES", "dependencies": [ ], "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "SLES", "operatingsystemrelease": [ "11 SP1", "12", "15" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "8", "9" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "16.04", "18.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": ">= 4.7.0 < 7.0.0" } ], - "template-url": "https://github.com/puppetlabs/pdk-templates/", - "template-ref": "1.9.0-0-g7281db5", - "pdk-version": "1.9.0" + "template-url": "https://github.com/puppetlabs/pdk-templates", + "template-ref": "heads/master-0-gfde5699", + "pdk-version": "1.8.0" } \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 149ff03..1f8b6b4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,52 +1,52 @@ RSpec.configure do |c| c.mock_with :rspec end require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) include RspecPuppetFacts default_facts = { puppetversion: Puppet.version, facterversion: Facter.version, } default_fact_files = [ File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), ] default_fact_files.each do |f| next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f))) + default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) rescue => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end end RSpec.configure do |c| c.default_facts = default_facts c.before :each do # set to strictest setting for testing # by default Puppet runs at warning level Puppet.settings[:strict] = :warning end c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] c.after(:suite) do RSpec::Puppet::Coverage.report!(0) end end def ensure_module_defined(module_name) module_name.split('::').reduce(Object) do |last_module, next_module| last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) last_module.const_get(next_module, false) end end # 'spec_overrides' from sync.yml will appear below this line