Skip to content

Commit dd42efd

Browse files
committed
(MODULES-11197) Update to pdk-templates 2.2.0
Includes REFERENCE.md ToC fixes for MODULES-8183.
1 parent 54db10d commit dd42efd

20 files changed

+309
-225
lines changed

.github/workflows/auto_release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: "Auto release"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
8+
HONEYCOMB_DATASET: litmus tests
9+
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
11+
jobs:
12+
auto_release:
13+
name: "Automatic release prep"
14+
runs-on: ubuntu-20.04
15+
16+
steps:
17+
- name: "Honeycomb: Start recording"
18+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
19+
with:
20+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
21+
dataset: ${{ env.HONEYCOMB_DATASET }}
22+
job-status: ${{ job.status }}
23+
24+
- name: "Honeycomb: start first step"
25+
run: |
26+
echo STEP_ID="auto-release" >> $GITHUB_ENV
27+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28+
29+
- name: "Checkout Source"
30+
if: ${{ github.repository_owner == 'puppetlabs' }}
31+
uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
persist-credentials: false
35+
36+
- name: "PDK Release prep"
37+
uses: docker://puppet/iac_release:ci
38+
with:
39+
args: 'release prep --force'
40+
env:
41+
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: "Get Version"
44+
if: ${{ github.repository_owner == 'puppetlabs' }}
45+
id: gv
46+
run: |
47+
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
48+
49+
- name: "Commit changes"
50+
if: ${{ github.repository_owner == 'puppetlabs' }}
51+
run: |
52+
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
53+
git config --local user.name "GitHub Action"
54+
git add .
55+
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
56+
57+
- name: Create Pull Request
58+
id: cpr
59+
uses: puppetlabs/peter-evans-create-pull-request@v3
60+
if: ${{ github.repository_owner == 'puppetlabs' }}
61+
with:
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
64+
branch: "release-prep"
65+
delete-branch: true
66+
title: "Release prep v${{ steps.gv.outputs.ver }}"
67+
body: |
68+
Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
69+
Please verify before merging:
70+
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
71+
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
72+
- [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
73+
labels: "maintenance"
74+
75+
- name: PR outputs
76+
if: ${{ github.repository_owner == 'puppetlabs' }}
77+
run: |
78+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
79+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
80+
81+
- name: "Honeycomb: Record finish step"
82+
if: ${{ always() }}
83+
run: |
84+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Publish module"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-github-release:
8+
name: Deploy GitHub Release
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.ref }}
15+
clean: true
16+
fetch-depth: 0
17+
- name: Get Version
18+
id: gv
19+
run: |
20+
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
21+
- name: Create Release
22+
uses: actions/create-release@v1
23+
id: create_release
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: "v${{ steps.gv.outputs.ver }}"
28+
draft: false
29+
prerelease: false
30+
31+
deploy-forge:
32+
name: Deploy to Forge
33+
runs-on: ubuntu-20.04
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
with:
38+
ref: ${{ github.ref }}
39+
clean: true
40+
- name: "PDK Build"
41+
uses: docker://puppet/pdk:nightly
42+
with:
43+
args: 'build'
44+
- name: "Push to Forge"
45+
uses: docker://puppet/pdk:nightly
46+
with:
47+
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'

.rubocop.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AllCops:
2020
- "**/Guardfile"
2121
Layout/LineLength:
2222
Description: People have wide screens, use them.
23-
Enabled: false
23+
Max: 260
2424
RSpec/BeforeAfterAll:
2525
Description: Beware of using after(:all) as it may cause state to leak between tests.
2626
A necessary evil in acceptance testing.
@@ -73,6 +73,8 @@ Style/SymbolArray:
7373
EnforcedStyle: brackets
7474
RSpec/NamedSubject:
7575
Enabled: false
76+
RSpec/SubjectStub:
77+
Enabled: false
7678
RSpec/MessageSpies:
7779
EnforcedStyle: receive
7880
Style/Documentation:
@@ -135,8 +137,6 @@ Layout/EmptyLineAfterGuardClause:
135137
Enabled: false
136138
Layout/EmptyLinesAroundArguments:
137139
Enabled: false
138-
Layout/EmptyLinesAroundBlockBody:
139-
Enabled: false
140140
Layout/EmptyLinesAroundAttributeAccessor:
141141
Enabled: false
142142
Layout/EndOfLine:
@@ -285,8 +285,6 @@ Performance/DeleteSuffix:
285285
Enabled: false
286286
Performance/InefficientHashSearch:
287287
Enabled: false
288-
Performance/RegexpMatch:
289-
Enabled: false
290288
Performance/UnfreezeString:
291289
Enabled: false
292290
Performance/UriDefaultParser:
@@ -317,8 +315,6 @@ RSpec/ExampleLength:
317315
Enabled: false
318316
RSpec/ExampleWithoutDescription:
319317
Enabled: false
320-
RSpec/ExampleWording:
321-
Enabled: false
322318
RSpec/ExpectChange:
323319
Enabled: false
324320
RSpec/ExpectInHook:
@@ -367,8 +363,6 @@ RSpec/SharedExamples:
367363
Enabled: false
368364
RSpec/StubbedMock:
369365
Enabled: false
370-
RSpec/SubjectStub:
371-
Enabled: false
372366
RSpec/UnspecifiedException:
373367
Enabled: false
374368
RSpec/VariableDefinition:
@@ -463,16 +457,12 @@ Style/RedundantRegexpCharacterClass:
463457
Enabled: false
464458
Style/RedundantRegexpEscape:
465459
Enabled: false
466-
Style/RedundantReturn:
467-
Enabled: false
468460
Style/RedundantSelfAssignment:
469461
Enabled: false
470462
Style/RedundantSort:
471463
Enabled: false
472464
Style/RescueStandardError:
473465
Enabled: false
474-
Style/SafeNavigation:
475-
Enabled: false
476466
Style/SingleArgumentDig:
477467
Enabled: false
478468
Style/SlicingWithRange:

.sync.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,41 @@
11
---
22
.rubocop.yml:
33
default_configs:
4-
Metrics/LineLength:
4+
Layout/LineLength:
55
Max: 260
66
RSpec/NamedSubject:
77
Enabled: false
8-
8+
RSpec/SubjectStub:
9+
Enabled: false
910
Gemfile:
10-
required:
11-
':system_tests':
12-
- gem: 'puppet-module-posix-system-r#{minor_version}'
13-
platforms: ruby
14-
version: '~> 1.0'
15-
- gem: 'puppet-module-win-system-r#{minor_version}'
16-
platforms:
17-
- mswin
18-
- mingw
19-
- x64_mingw
20-
version: '~> 1.0'
11+
optional:
12+
":development":
2113
- gem: beaker
22-
version: '~> 3.34'
14+
version: '~> 4.30'
2315
from_env: BEAKER_VERSION
2416
- gem: beaker-abs
2517
from_env: BEAKER_ABS_VERSION
26-
version: '~> 0.5'
18+
version: '~> 0.9'
2719
- gem: beaker-pe
2820
- gem: beaker-hostgenerator
2921
from_env: BEAKER_HOSTGENERATOR_VERSION
3022
- gem: beaker-rspec
3123
from_env: BEAKER_RSPEC_VERSION
3224
- gem: beaker-puppet
3325
from_env: BEAKER_PUPPET_VERSION
34-
version: '~> 0.14'
35-
optional:
36-
':development':
37-
- gem: 'github_changelog_generator'
38-
git: 'https://github.com/skywinder/github-changelog-generator'
39-
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
40-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
41-
42-
.gitlab-ci.yml:
43-
delete: true
26+
version: '~> 1.22'
27+
- gem: github_changelog_generator
28+
- gem: beaker-module_install_helper
29+
- gem: beaker-puppet_install_helper
30+
- gem: nokogiri
4431

4532
appveyor.yml:
4633
delete: true
47-
4834
.travis.yml:
49-
remove_includes:
50-
- env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
51-
rvm: 2.1.9
52-
53-
Rakefile:
54-
changelog_version_tag_pattern: '%s'
35+
delete: true
36+
.github/workflows/auto_release.yml:
37+
unmanaged: false
38+
.github/workflows/release.yml:
39+
unmanaged: false
40+
.gitlab-ci.yml:
41+
delete: true

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

Gemfile

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,27 @@ 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 "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
21-
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))
22-
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23-
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
24-
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
25-
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
26-
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27-
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')
28-
end
29-
group :system_tests do
30-
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
31-
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
32-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.34')
33-
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.5')
20+
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
21+
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))
22+
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23+
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
24+
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
25+
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
26+
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.30')
28+
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.9')
3429
gem "beaker-pe", require: false
3530
gem "beaker-hostgenerator"
3631
gem "beaker-rspec"
37-
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 0.14')
32+
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 1.22')
33+
gem "github_changelog_generator", require: false
34+
gem "beaker-module_install_helper", require: false
35+
gem "beaker-puppet_install_helper", require: false
36+
gem "nokogiri", require: false
37+
end
38+
group :system_tests do
39+
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
40+
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3841
end
3942

4043
puppet_version = ENV['PUPPET_GEM_VERSION']

0 commit comments

Comments
 (0)