Skip to content

Commit 59aa752

Browse files
committed
pdk update
1 parent 8ec63d7 commit 59aa752

File tree

8 files changed

+77
-46
lines changed

8 files changed

+77
-46
lines changed

.devcontainer/README.md

Lines changed: 34 additions & 0 deletions
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

Lines changed: 5 additions & 11 deletions
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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-20.04
1515

1616
steps:
17+
1718
- name: "Honeycomb: Start recording"
1819
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
1920
with:
@@ -25,7 +26,6 @@ jobs:
2526
run: |
2627
echo STEP_ID="auto-release" >> $GITHUB_ENV
2728
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28-
2929
- name: "Checkout Source"
3030
if: ${{ github.repository_owner == 'puppetlabs' }}
3131
uses: actions/checkout@v2
@@ -46,8 +46,14 @@ jobs:
4646
run: |
4747
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
4848
49-
- name: "Commit changes"
49+
- name: "Check if a release is necessary"
5050
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' }}
5157
run: |
5258
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
5359
git config --local user.name "GitHub Action"
@@ -57,7 +63,7 @@ jobs:
5763
- name: Create Pull Request
5864
id: cpr
5965
uses: puppetlabs/peter-evans-create-pull-request@v3
60-
if: ${{ github.repository_owner == 'puppetlabs' }}
66+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
6167
with:
6268
token: ${{ secrets.GITHUB_TOKEN }}
6369
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
@@ -73,11 +79,11 @@ jobs:
7379
labels: "maintenance"
7480

7581
- name: PR outputs
76-
if: ${{ github.repository_owner == 'puppetlabs' }}
82+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
7783
run: |
7884
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
7985
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
80-
86+
8187
- name: "Honeycomb: Record finish step"
8288
if: ${{ always() }}
8389
run: |

.github/workflows/nightly.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
schedule:
55
- cron: '0 0 * * *'
66

7+
78
env:
89
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
910
HONEYCOMB_DATASET: litmus tests
@@ -16,6 +17,7 @@ jobs:
1617
matrix: ${{ steps.get-matrix.outputs.matrix }}
1718

1819
steps:
20+
1921
- name: "Honeycomb: Start recording"
2022
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2123
with:
@@ -27,7 +29,6 @@ jobs:
2729
run: |
2830
echo STEP_ID=setup-environment >> $GITHUB_ENV
2931
echo STEP_START=$(date +%s) >> $GITHUB_ENV
30-
3132
- name: Checkout Source
3233
uses: actions/checkout@v2
3334
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -45,14 +46,13 @@ jobs:
4546
echo ::group::bundler environment
4647
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4748
echo ::endgroup::
48-
49+
4950
- name: "Honeycomb: Record Setup Environment time"
5051
if: ${{ github.repository_owner == 'puppetlabs' }}
5152
run: |
5253
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5354
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5455
echo STEP_START=$(date +%s) >> $GITHUB_ENV
55-
5656
- name: Setup Acceptance Test Matrix
5757
id: get-matrix
5858
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -62,12 +62,11 @@ jobs:
6262
else
6363
echo "::set-output name=matrix::{}"
6464
fi
65-
65+
6666
- name: "Honeycomb: Record Setup Test Matrix time"
6767
if: ${{ always() }}
6868
run: |
6969
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
70-
7170
Acceptance:
7271
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
7372
needs:

.github/workflows/pr_test.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: "PR Testing"
22

33
on: [pull_request]
44

5+
56
env:
7+
68
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
79
HONEYCOMB_DATASET: litmus tests
810

@@ -14,6 +16,7 @@ jobs:
1416
matrix: ${{ steps.get-matrix.outputs.matrix }}
1517

1618
steps:
19+
1720
- name: "Honeycomb: Start recording"
1821
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
1922
with:
@@ -25,7 +28,6 @@ jobs:
2528
run: |
2629
echo STEP_ID=setup-environment >> $GITHUB_ENV
2730
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28-
2931
- name: Checkout Source
3032
uses: actions/checkout@v2
3133
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -43,13 +45,17 @@ jobs:
4345
echo ::group::bundler environment
4446
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4547
echo ::endgroup::
46-
48+
4749
- name: "Honeycomb: Record Setup Environment time"
4850
if: ${{ github.repository_owner == 'puppetlabs' }}
4951
run: |
5052
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5153
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5254
echo STEP_START=$(date +%s) >> $GITHUB_ENV
55+
- name: Run validation steps
56+
run: |
57+
bundle exec rake validate
58+
if: ${{ github.repository_owner == 'puppetlabs' }}
5359

5460
- name: Setup Acceptance Test Matrix
5561
id: get-matrix
@@ -59,12 +65,11 @@ jobs:
5965
else
6066
echo "::set-output name=matrix::{}"
6167
fi
62-
68+
6369
- name: "Honeycomb: Record Setup Test Matrix time"
6470
if: ${{ always() }}
6571
run: |
6672
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
67-
6873
Acceptance:
6974
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
7075
needs:
@@ -84,7 +89,7 @@ jobs:
8489
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
8590
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
8691
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
87-
92+
8893
- name: "Honeycomb: Start recording"
8994
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9095
with:
@@ -97,7 +102,6 @@ jobs:
97102
run: |
98103
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
99104
echo STEP_START=$(date +%s) >> $GITHUB_ENV
100-
101105
- name: Checkout Source
102106
uses: actions/checkout@v2
103107

@@ -112,14 +116,13 @@ jobs:
112116
echo ::group::bundler environment
113117
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
114118
echo ::endgroup::
115-
119+
116120
- name: "Honeycomb: Record Setup Environment time"
117121
if: ${{ always() }}
118122
run: |
119123
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
120124
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
121125
echo STEP_START=$(date +%s) >> $GITHUB_ENV
122-
123126
- name: Provision test environment
124127
run: |
125128
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
@@ -145,7 +148,7 @@ jobs:
145148
- name: Install module
146149
run: |
147150
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
148-
151+
149152
- name: "Honeycomb: Record deployment times"
150153
if: ${{ always() }}
151154
run: |
@@ -154,18 +157,16 @@ jobs:
154157
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
155158
echo STEP_START=$(date +%s) >> $GITHUB_ENV
156159
echo ::endgroup::
157-
158160
- name: Run acceptance tests
159161
run: |
160162
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
161-
163+
162164
- name: "Honeycomb: Record acceptance testing times"
163165
if: ${{ always() }}
164166
run: |
165167
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
166168
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
167169
echo STEP_START=$(date +%s) >> $GITHUB_ENV
168-
169170
- name: Remove test environment
170171
if: ${{ always() }}
171172
continue-on-error: true
@@ -177,7 +178,7 @@ jobs:
177178
echo
178179
echo ::endgroup::
179180
fi
180-
181+
181182
- name: "Honeycomb: Record removal times"
182183
if: ${{ always() }}
183184
run: |

.github/workflows/spec.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
workflow_dispatch:
77
pull_request:
88

9+
910
env:
1011
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
1112
HONEYCOMB_DATASET: litmus tests
@@ -18,6 +19,7 @@ jobs:
1819
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }}
1920

2021
steps:
22+
2123
- name: "Honeycomb: Start recording"
2224
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2325
with:
@@ -29,7 +31,6 @@ jobs:
2931
run: |
3032
echo STEP_ID=setup-environment >> $GITHUB_ENV
3133
echo STEP_START=$(date +%s) >> $GITHUB_ENV
32-
3334
- name: Checkout Source
3435
uses: actions/checkout@v2
3536
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -47,13 +48,16 @@ jobs:
4748
echo ::group::bundler environment
4849
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4950
echo ::endgroup::
50-
5151
- name: "Honeycomb: Record Setup Environment time"
5252
if: ${{ github.repository_owner == 'puppetlabs' }}
5353
run: |
5454
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5555
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5656
echo STEP_START=$(date +%s) >> $GITHUB_ENV
57+
- name: Run Static & Syntax Tests
58+
if: ${{ github.repository_owner == 'puppetlabs' }}
59+
run: |
60+
buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
5761
5862
- name: Setup Spec Test Matrix
5963
id: get-matrix
@@ -63,12 +67,10 @@ jobs:
6367
else
6468
echo "::set-output name=spec_matrix::{}"
6569
fi
66-
6770
- name: "Honeycomb: Record Setup Test Matrix time"
6871
if: ${{ always() }}
6972
run: |
7073
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
71-
7274
Spec:
7375
name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
7476
needs:
@@ -91,7 +93,6 @@ jobs:
9193
9294
- run: |
9395
echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE
94-
9596
- name: "Honeycomb: Start first step"
9697
run: |
9798
echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV
@@ -104,7 +105,6 @@ jobs:
104105
dataset: ${{ env.HONEYCOMB_DATASET }}
105106
job-status: ${{ job.status }}
106107
matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }}
107-
108108
- name: Checkout Source
109109
uses: actions/checkout@v2
110110

@@ -120,10 +120,6 @@ jobs:
120120
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
121121
echo ::endgroup::
122122
123-
- name: Run Static & Syntax Tests
124-
run: |
125-
buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
126-
127123
- name: Run parallel_spec tests
128124
run: |
129125
buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec

Rakefile

Lines changed: 1 addition & 0 deletions
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?

0 commit comments

Comments
 (0)