Skip to content

Commit 3500d37

Browse files
author
Rajesh
committed
adding changes made by pdk upate after adding .sync.yml
1 parent a8e67f9 commit 3500d37

14 files changed

+219
-29
lines changed

.devcontainer/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# devcontainer
2+
3+
4+
For format details, see https://aka.ms/devcontainer.json.
5+
6+
For config options, see the README at:
7+
https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
8+
9+
``` json
10+
{
11+
"name": "Puppet Development Kit (Community)",
12+
"dockerFile": "Dockerfile",
13+
14+
// Set *default* container specific settings.json values on container create.
15+
"settings": {
16+
"terminal.integrated.shell.linux": "/bin/bash"
17+
},
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [
21+
"puppet.puppet-vscode",
22+
"rebornix.Ruby"
23+
]
24+
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
"forwardPorts": [],
27+
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
"postCreateCommand": "pdk --version",
30+
}
31+
```
32+
33+
34+

.devcontainer/devcontainer.json

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
31
{
42
"name": "Puppet Development Kit (Community)",
53
"dockerFile": "Dockerfile",
64

7-
// Set *default* container specific settings.json values on container create.
85
"settings": {
9-
"terminal.integrated.shell.linux": "/bin/bash"
6+
"terminal.integrated.profiles.linux": {
7+
"bash": {
8+
"path": "bash",
9+
}
10+
}
1011
},
1112

12-
// Add the IDs of extensions you want installed when the container is created.
1313
"extensions": [
1414
"puppet.puppet-vscode",
1515
"rebornix.Ruby"
1616
]
17-
18-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19-
// "forwardPorts": [],
20-
21-
// Use 'postCreateCommand' to run commands after the container is created.
22-
// "postCreateCommand": "pdk --version",
2317
}

.github/workflows/auto_release.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
18+
- name: "Honeycomb: Start recording"
19+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
20+
with:
21+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
22+
dataset: ${{ env.HONEYCOMB_DATASET }}
23+
job-status: ${{ job.status }}
24+
25+
- name: "Honeycomb: start first step"
26+
run: |
27+
echo STEP_ID="auto-release" >> $GITHUB_ENV
28+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
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: "Check if a release is necessary"
50+
if: ${{ github.repository_owner == 'puppetlabs' }}
51+
id: check
52+
run: |
53+
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
54+
55+
- name: "Commit changes"
56+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
57+
run: |
58+
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
59+
git config --local user.name "GitHub Action"
60+
git add .
61+
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
62+
63+
- name: Create Pull Request
64+
id: cpr
65+
uses: puppetlabs/peter-evans-create-pull-request@v3
66+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
67+
with:
68+
token: ${{ secrets.GITHUB_TOKEN }}
69+
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
70+
branch: "release-prep"
71+
delete-branch: true
72+
title: "Release prep v${{ steps.gv.outputs.ver }}"
73+
body: |
74+
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 }}.
75+
Please verify before merging:
76+
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
77+
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
78+
- [ ] 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
79+
labels: "maintenance"
80+
81+
- name: PR outputs
82+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
83+
run: |
84+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
85+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
86+
87+
- name: "Honeycomb: Record finish step"
88+
if: ${{ always() }}
89+
run: |
90+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'

.github/workflows/release.yml

+47
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'

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525
.project
2626
.envrc
2727
/inventory.yaml
28+
/spec/fixtures/litmus_inventory.yaml

.gitlab-ci.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ default:
1919
- bundle -v
2020
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
2121

22-
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.7-Puppet ~> 6:
22+
validate lint check rubocop-Ruby 2.5.7-Puppet ~> 6:
2323
stage: syntax
2424
image: ruby:2.5.7
2525
script:
26-
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
26+
- bundle exec rake validate lint check rubocop
2727
variables:
2828
PUPPET_GEM_VERSION: '~> 6'
2929

@@ -35,3 +35,19 @@ parallel_spec-Ruby 2.5.7-Puppet ~> 6:
3535
variables:
3636
PUPPET_GEM_VERSION: '~> 6'
3737

38+
validate lint check rubocop-Ruby 2.7.2-Puppet ~> 7:
39+
stage: syntax
40+
image: ruby:2.7.2
41+
script:
42+
- bundle exec rake validate lint check rubocop
43+
variables:
44+
PUPPET_GEM_VERSION: '~> 7'
45+
46+
parallel_spec-Ruby 2.7.2-Puppet ~> 7:
47+
stage: unit
48+
image: ruby:2.7.2
49+
script:
50+
- bundle exec rake parallel_spec
51+
variables:
52+
PUPPET_GEM_VERSION: '~> 7'
53+

.pdkignore

+3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
.project
2626
.envrc
2727
/inventory.yaml
28+
/spec/fixtures/litmus_inventory.yaml
2829
/appveyor.yml
30+
/.editorconfig
2931
/.fixtures.yml
3032
/Gemfile
3133
/.gitattributes
@@ -42,3 +44,4 @@
4244
/spec/
4345
/.vscode/
4446
/.sync.yml
47+
/.devcontainer/

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require:
44
- rubocop-rspec
55
AllCops:
66
DisplayCopNames: true
7-
TargetRubyVersion: '2.6'
7+
TargetRubyVersion: '2.4'
88
Include:
99
- "**/*.rb"
1010
Exclude:

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fast_finish: true
2929
include:
3030
-
31-
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
31+
env: CHECK="validate lint check rubocop"
3232
stage: static
3333
-
3434
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec

Gemfile

+1-10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ group :development do
2424
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
2525
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
2626
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27+
gem "github_changelog_generator", require: false
2728
end
2829
group :system_tests do
2930
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
@@ -44,16 +45,6 @@ gems['puppet'] = location_for(puppet_version)
4445
gems['facter'] = location_for(facter_version) if facter_version
4546
gems['hiera'] = location_for(hiera_version) if hiera_version
4647

47-
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
48-
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
49-
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
50-
gems['win32-dir'] = ['<= 0.4.9', require: false]
51-
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
52-
gems['win32-process'] = ['<= 0.7.5', require: false]
53-
gems['win32-security'] = ['<= 0.2.5', require: false]
54-
gems['win32-service'] = ['0.8.8', require: false]
55-
end
56-
5748
gems.each do |gem_name, gem_params|
5849
gem gem_name, *gem_params
5950
end

Rakefile

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ end
4343

4444
PuppetLint.configuration.send('disable_relative')
4545

46+
4647
if Bundler.rubygems.find_name('github_changelog_generator').any?
4748
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
4849
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?

appveyor.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
version: 1.1.x.{build}
3+
skip_branch_with_pr: true
34
branches:
45
only:
56
- main
@@ -17,7 +18,7 @@ environment:
1718
matrix:
1819
-
1920
RUBY_VERSION: 25-x64
20-
CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
21+
CHECK: validate lint check rubocop
2122
-
2223
PUPPET_GEM_VERSION: ~> 6.0
2324
RUBY_VERSION: 25

metadata.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"version_requirement": ">= 6.0.0 < 8.0.0"
103103
}
104104
],
105-
"pdk-version": "2.0.0",
106-
"template-url": "pdk-default#2.0.0",
107-
"template-ref": "tags/2.0.0-0-ge838f1d"
105+
"pdk-version": "2.3.0",
106+
"template-url": "pdk-default#2.3.0",
107+
"template-ref": "tags/2.3.0-0-g8aaceff"
108108
}

spec/spec_helper.rb

+12
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@
4747
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
4848
c.after(:suite) do
4949
end
50+
51+
# Filter backtrace noise
52+
backtrace_exclusion_patterns = [
53+
%r{spec_helper},
54+
%r{gems},
55+
]
56+
57+
if c.respond_to?(:backtrace_exclusion_patterns)
58+
c.backtrace_exclusion_patterns = backtrace_exclusion_patterns
59+
elsif c.respond_to?(:backtrace_clean_patterns)
60+
c.backtrace_clean_patterns = backtrace_exclusion_patterns
61+
end
5062
end
5163

5264
# Ensures that a module is defined

0 commit comments

Comments
 (0)