Skip to content

Commit d8a2211

Browse files
authored
Merge pull request #27 from puppetlabs/pdksync_update-pdk
pdksync - (maint) Update module using PDK 1.14.0
2 parents 0e6e663 + cb746fc commit d8a2211

File tree

12 files changed

+106
-38
lines changed

12 files changed

+106
-38
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
/convert_report.txt
2323
/update_report.txt
2424
.DS_Store
25+
.project
26+
.envrc
27+
/inventory.yaml

.pdkignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
/convert_report.txt
2323
/update_report.txt
2424
.DS_Store
25+
.project
26+
.envrc
27+
/inventory.yaml
2528
/appveyor.yml
2629
/.fixtures.yml
2730
/Gemfile
@@ -30,8 +33,10 @@
3033
/.gitlab-ci.yml
3134
/.pdkignore
3235
/Rakefile
36+
/rakelib/
3337
/.rspec
3438
/.rubocop.yml
3539
/.travis.yml
3640
/.yardopts
3741
/spec/
42+
/.vscode/

.rubocop.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
require: rubocop-rspec
2+
require:
3+
- rubocop-rspec
4+
- rubocop-i18n
35
AllCops:
46
DisplayCopNames: true
57
TargetRubyVersion: '2.1'
@@ -19,10 +21,13 @@ AllCops:
1921
Metrics/LineLength:
2022
Description: People have wide screens, use them.
2123
Max: 260
24+
GetText:
25+
Enabled: false
2226
GetText/DecorateString:
2327
Description: We don't want to decorate test output.
2428
Exclude:
25-
- spec/*
29+
- spec/**/*
30+
Enabled: false
2631
RSpec/BeforeAfterAll:
2732
Description: Beware of using after(:all) as it may cause state to leak between tests.
2833
A necessary evil in acceptance testing.
@@ -86,6 +91,12 @@ Style/MethodCalledOnDoEndBlock:
8691
Enabled: true
8792
Style/StringMethods:
8893
Enabled: true
94+
GetText/DecorateFunctionMessage:
95+
Enabled: false
96+
GetText/DecorateStringFormattingUsingInterpolation:
97+
Enabled: false
98+
GetText/DecorateStringFormattingUsingPercent:
99+
Enabled: false
89100
Layout/EndOfLine:
90101
Enabled: false
91102
Layout/IndentHeredoc:

.travis.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
dist: trusty
2+
dist: xenial
33
language: ruby
44
cache: bundler
55
before_install:
@@ -12,32 +12,34 @@ script:
1212
- 'bundle exec rake $CHECK'
1313
bundler_args: --without system_tests
1414
rvm:
15-
- 2.5.1
16-
env:
17-
global:
18-
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
15+
- 2.5.3
16+
stages:
17+
- static
18+
- spec
19+
- acceptance
20+
-
21+
if: tag =~ ^v\d
22+
name: deploy
1923
matrix:
2024
fast_finish: true
2125
include:
2226
-
23-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
24-
-
25-
env: CHECK=parallel_spec
27+
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
28+
stage: static
2629
-
2730
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
28-
rvm: 2.4.4
31+
rvm: 2.4.5
32+
stage: spec
33+
-
34+
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
35+
rvm: 2.5.3
36+
stage: spec
37+
-
38+
env: DEPLOY_TO_FORGE=yes
39+
stage: deploy
2940
branches:
3041
only:
3142
- master
3243
- /^v\d/
3344
notifications:
3445
email: false
35-
deploy:
36-
provider: puppetforge
37-
user: puppet
38-
password:
39-
secure: ""
40-
on:
41-
tags: true
42-
all_branches: true
43-
condition: "$DEPLOY_TO_FORGE = yes"

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"jpogran.puppet-vscode",
4+
"rebornix.Ruby"
5+
]
6+
}

Gemfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
1717
minor_version = ruby_version_segments[0..1].join('.')
1818

1919
group :development do
20-
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
21-
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
22-
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
23-
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
24-
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
25-
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
26-
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
27-
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
28-
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
29-
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
30-
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
20+
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
21+
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
22+
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
23+
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
24+
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
25+
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
26+
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27+
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
28+
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
29+
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
30+
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
31+
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
3132
end
3233
group :system_tests do
3334
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]

Rakefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
12
require 'puppetlabs_spec_helper/rake_tasks'
23
require 'puppet-syntax/tasks/puppet-syntax'
34
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
@@ -14,15 +15,24 @@ end
1415

1516
def changelog_project
1617
return unless Rake.application.top_level_tasks.include? "changelog"
17-
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
18-
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
18+
19+
returnVal = nil
20+
returnVal ||= begin
21+
metadata_source = JSON.load(File.read('metadata.json'))['source']
22+
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
23+
24+
metadata_source_match && metadata_source_match[1]
25+
end
26+
27+
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
28+
1929
puts "GitHubChangelogGenerator project:#{returnVal}"
2030
returnVal
2131
end
2232

2333
def changelog_future_release
2434
return unless Rake.application.top_level_tasks.include? "changelog"
25-
returnVal = JSON.load(File.read('metadata.json'))['version']
35+
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
2636
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
2737
puts "GitHubChangelogGenerator future_release:#{returnVal}"
2838
returnVal

data/common.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---

hiera.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
version: 5
3+
4+
defaults: # Used for any hierarchy level that omits these keys.
5+
datadir: data # This path is relative to hiera.yaml's directory.
6+
data_hash: yaml_data # Use the built-in YAML backend.
7+
8+
hierarchy:
9+
- name: "osfamily/major release"
10+
paths:
11+
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
12+
# Used for Solaris
13+
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
14+
# Used to distinguish between Debian and Ubuntu
15+
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
16+
- name: "osfamily"
17+
paths:
18+
- "os/%{facts.os.family}.yaml"
19+
- "os/%{facts.os.name}.yaml"
20+
- name: 'common'
21+
path: 'common.yaml'

metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"version_requirement": ">= 6.0.0 < 7.0.0"
7979
}
8080
],
81-
"pdk-version": "1.9.0",
82-
"template-url": "https://github.com/puppetlabs/pdk-templates/",
83-
"template-ref": "1.9.0-0-g7281db5"
81+
"pdk-version": "1.14.0",
82+
"template-url": "https://github.com/puppetlabs/pdk-templates#1.14.0",
83+
"template-ref": "1.14.0-0-g1bf3a4e"
8484
}

0 commit comments

Comments
 (0)