Skip to content

Commit 0c53cc3

Browse files
author
Ciprian Badescu
committed
(MODULES-11244) pdk convert
1 parent bc65216 commit 0c53cc3

20 files changed

+738
-733
lines changed

.devcontainer/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM puppet/pdk:latest
2+
3+
# [Optional] Uncomment this section to install additional packages.
4+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
# && apt-get -y install --no-install-recommends <your-package-list-here>
6+

.devcontainer/devcontainer.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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
3+
{
4+
"name": "Puppet Development Kit (Community)",
5+
"dockerFile": "Dockerfile",
6+
7+
// Set *default* container specific settings.json values on container create.
8+
"settings": {
9+
"terminal.integrated.shell.linux": "/bin/bash"
10+
},
11+
12+
// Add the IDs of extensions you want installed when the container is created.
13+
"extensions": [
14+
"puppet.puppet-vscode",
15+
"rebornix.Ruby"
16+
]
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",
23+
}

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#This file is generated by ModuleSync, do not edit.
21
*.rb eol=lf
32
*.erb eol=lf
43
*.pp eol=lf

.github/workflows/auto_release.yml

+84
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

+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

+24-25
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
# This file is generated by ModuleSync, do not edit.
2-
*.iml
1+
.git/
32
.*.sw[op]
4-
.DS_Store
5-
.beaker/
6-
.bundle/
7-
.idea/
83
.metadata
9-
.vagrant/
104
.yardoc
115
.yardwarns
12-
Gemfile.local
13-
Gemfile.lock
14-
bin/
15-
coverage/
16-
doc/
17-
hosts.yaml
18-
hosts.yml
19-
junit/
20-
log/
21-
pkg/
22-
spec/fixtures/manifests/
23-
spec/fixtures/modules/
24-
task_spec/spec/fixtures/manifests/
25-
task_spec/spec/fixtures/modules/
26-
tmp/
27-
vendor/
28-
29-
.*.sw?
6+
*.iml
7+
/.bundle/
8+
/.idea/
9+
/.vagrant/
10+
/coverage/
11+
/bin/
12+
/doc/
13+
/Gemfile.local
14+
/Gemfile.lock
15+
/junit/
16+
/log/
17+
/pkg/
18+
/spec/fixtures/manifests/
19+
/spec/fixtures/modules/
20+
/tmp/
21+
/vendor/
22+
/convert_report.txt
23+
/update_report.txt
24+
.DS_Store
25+
.project
26+
.envrc
27+
/inventory.yaml
28+
/spec/fixtures/litmus_inventory.yaml

.pdkignore

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@
77
/.bundle/
88
/.idea/
99
/.vagrant/
10-
/acceptance/
1110
/coverage/
1211
/bin/
1312
/doc/
14-
/docker/
1513
/Gemfile.local
1614
/Gemfile.lock
1715
/junit/
1816
/log/
1917
/pkg/
2018
/spec/fixtures/manifests/
2119
/spec/fixtures/modules/
22-
/task_spec/
2320
/tmp/
2421
/vendor/
2522
/convert_report.txt
@@ -28,22 +25,23 @@
2825
.project
2926
.envrc
3027
/inventory.yaml
28+
/spec/fixtures/litmus_inventory.yaml
3129
/appveyor.yml
30+
/.editorconfig
3231
/.fixtures.yml
3332
/Gemfile
3433
/.gitattributes
3534
/.gitignore
36-
/.github/
3735
/.gitlab-ci.yml
3836
/.pdkignore
3937
/.puppet-lint.rc
4038
/Rakefile
4139
/rakelib/
4240
/.rspec
4341
/.rubocop.yml
44-
/.rubocop_todo.yml
4542
/.travis.yml
4643
/.yardopts
4744
/spec/
4845
/.vscode/
4946
/.sync.yml
47+
/.devcontainer/

.puppet-lint.rc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--relative

0 commit comments

Comments
 (0)