Skip to content

Commit d08bfc6

Browse files
authored
Merge pull request #1305 from puppetlabs/pdksync_IAC-1751/main/add_rocky_8_support
pdksync - (IAC-1751) - Add Support for Rocky 8
2 parents dc636d8 + 5da572d commit d08bfc6

File tree

11 files changed

+497
-48
lines changed

11 files changed

+497
-48
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: 5 additions & 6 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,29 +46,27 @@ 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' }}
5959
run: |
6060
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
61-
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
61+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 --exclude-platforms '["Scientific-6", "Scientific-7", "Debian-9", "Debian-10", "Debian-11", "SLES-12", "SLES-15", "Ubuntu-14.04", "Ubuntu-16.04", "Ubuntu-18.04", "Ubuntu-20.04"]'
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:
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
name: "nightly"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
8+
env:
9+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
10+
HONEYCOMB_DATASET: litmus tests
11+
12+
jobs:
13+
setup_matrix:
14+
name: "Setup Test Matrix"
15+
runs-on: ubuntu-20.04
16+
outputs:
17+
matrix: ${{ steps.get-matrix.outputs.matrix }}
18+
19+
steps:
20+
21+
- name: "Honeycomb: Start recording"
22+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
23+
with:
24+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
25+
dataset: ${{ env.HONEYCOMB_DATASET }}
26+
job-status: ${{ job.status }}
27+
28+
- name: "Honeycomb: Start first step"
29+
run: |
30+
echo STEP_ID=setup-environment >> $GITHUB_ENV
31+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
32+
- name: Checkout Source
33+
uses: actions/checkout@v2
34+
if: ${{ github.repository_owner == 'puppetlabs' }}
35+
36+
- name: Activate Ruby 2.7
37+
uses: ruby/setup-ruby@v1
38+
if: ${{ github.repository_owner == 'puppetlabs' }}
39+
with:
40+
ruby-version: "2.7"
41+
bundler-cache: true
42+
43+
- name: Print bundle environment
44+
if: ${{ github.repository_owner == 'puppetlabs' }}
45+
run: |
46+
echo ::group::bundler environment
47+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
48+
echo ::endgroup::
49+
50+
- name: "Honeycomb: Record Setup Environment time"
51+
if: ${{ github.repository_owner == 'puppetlabs' }}
52+
run: |
53+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
54+
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
55+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
56+
- name: Setup Acceptance Test Matrix
57+
id: get-matrix
58+
if: ${{ github.repository_owner == 'puppetlabs' }}
59+
run: |
60+
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
61+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 --exclude-platforms '["RedHat-6", "RedHat-7", "RedHat-8", "CentOS-6", "CentOS-7", "CentOS-8", "OracleLinux-6", "OracleLinux-7", "Rocky-8"]'
62+
else
63+
echo "::set-output name=matrix::{}"
64+
fi
65+
66+
- name: "Honeycomb: Record Setup Test Matrix time"
67+
if: ${{ always() }}
68+
run: |
69+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
70+
Acceptance:
71+
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
72+
needs:
73+
- setup_matrix
74+
75+
runs-on: ubuntu-20.04
76+
strategy:
77+
fail-fast: false
78+
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
79+
80+
env:
81+
BUILDEVENT_FILE: '../buildevents.txt'
82+
83+
steps:
84+
- run: |
85+
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
86+
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
87+
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
88+
89+
90+
- name: "Honeycomb: Start recording"
91+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
92+
with:
93+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
94+
dataset: ${{ env.HONEYCOMB_DATASET }}
95+
job-status: ${{ job.status }}
96+
matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}
97+
98+
- name: "Honeycomb: start first step"
99+
run: |
100+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
101+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
102+
103+
- name: Checkout Source
104+
uses: actions/checkout@v2
105+
106+
- name: Activate Ruby 2.7
107+
uses: ruby/setup-ruby@v1
108+
with:
109+
ruby-version: "2.7"
110+
bundler-cache: true
111+
112+
- name: Print bundle environment
113+
run: |
114+
echo ::group::bundler environment
115+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
116+
echo ::endgroup::
117+
118+
- name: "Honeycomb: Record Setup Environment time"
119+
if: ${{ always() }}
120+
run: |
121+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
122+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
123+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
124+
125+
- name: Provision test environment
126+
run: |
127+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
128+
echo ::group::=== REQUEST ===
129+
cat request.json || true
130+
echo
131+
echo ::endgroup::
132+
echo ::group::=== INVENTORY ===
133+
if [ -f 'spec/fixtures/litmus_inventory.yaml' ];
134+
then
135+
FILE='spec/fixtures/litmus_inventory.yaml'
136+
elif [ -f 'inventory.yaml' ];
137+
then
138+
FILE='inventory.yaml'
139+
fi
140+
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
141+
echo ::endgroup::
142+
143+
- name: Install agent
144+
run: |
145+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
146+
147+
- name: Install module
148+
run: |
149+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
150+
151+
- name: "Honeycomb: Record deployment times"
152+
if: ${{ always() }}
153+
run: |
154+
echo ::group::honeycomb step
155+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
156+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
157+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
158+
echo ::endgroup::
159+
160+
- name: Run acceptance tests
161+
run: |
162+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
163+
164+
- name: "Honeycomb: Record acceptance testing times"
165+
if: ${{ always() }}
166+
run: |
167+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
168+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
169+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
170+
171+
- name: Remove test environment
172+
if: ${{ always() }}
173+
continue-on-error: true
174+
run: |
175+
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
176+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
177+
echo ::group::=== REQUEST ===
178+
cat request.json || true
179+
echo
180+
echo ::endgroup::
181+
fi
182+
183+
- name: "Honeycomb: Record removal times"
184+
if: ${{ always() }}
185+
run: |
186+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
187+
188+
slack-workflow-status:
189+
if: always()
190+
name: Post Workflow Status To Slack
191+
needs:
192+
- Acceptance
193+
runs-on: ubuntu-20.04
194+
steps:
195+
- name: Slack Workflow Notification
196+
uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1
197+
with:
198+
# Required Input
199+
repo_token: ${{ secrets.GITHUB_TOKEN }}
200+
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
201+
# Optional Input
202+
channel: '#team-ia-bots'
203+
name: 'GABot'

0 commit comments

Comments
 (0)