21
21
required : true
22
22
default : ' false'
23
23
24
- env :
25
- HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
26
- HONEYCOMB_DATASET : litmus tests
27
-
28
24
jobs :
29
- test-backup-restore :
30
- name : " PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}"
25
+ install-cluster-A :
26
+ name : " Cluster A: PE ${{ inputs.version }} ${{ inputs.architecture }} on ${{ inputs.image }}"
27
+ runs-on : ubuntu-20.04
28
+ env :
29
+ BOLT_GEM : true
30
+ BOLT_DISABLE_ANALYTICS : true
31
+ BUILDEVENT_FILE : ' ../buildevents.txt'
32
+ LANG : ' en_US.UTF-8'
33
+
34
+ steps :
35
+ - name : " Checkout Source"
36
+ uses : actions/checkout@v2
37
+
38
+ - name : " Activate Ruby 2.7"
39
+ uses : ruby/setup-ruby@v1
40
+ with :
41
+ ruby-version : " 2.7"
42
+ bundler-cache : true
43
+
44
+ - name : " Print bundle environment"
45
+ if : ${{ github.repository_owner == 'puppetlabs' }}
46
+ run : |
47
+ echo ::group::info:bundler
48
+ buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
49
+ echo ::endgroup::
50
+
51
+ - name : ' Provision test cluster'
52
+ timeout-minutes : 15
53
+ run : |
54
+ echo ::group::prepare
55
+ mkdir -p $HOME/.ssh
56
+ echo 'Host *' > $HOME/.ssh/config
57
+ echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
58
+ echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
59
+ buildevents cmd $TRACE_ID $STEP_ID 'rake spec_prep' -- bundle exec rake spec_prep
60
+ echo ::endgroup::
61
+
62
+ echo ::group::provision
63
+ buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::provision_test_cluster' -- \
64
+ bundle exec bolt plan run peadm_spec::provision_test_cluster \
65
+ --modulepath spec/fixtures/modules \
66
+ provider=provision_service \
67
+ image=${{ inputs.image }} \
68
+ architecture=${{ inputs.architecture }}
69
+ echo ::endgroup::
70
+
71
+ echo ::group::info:request
72
+ cat request.json || true; echo
73
+ echo ::endgroup::
74
+
75
+ echo ::group::info:inventory
76
+ sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
77
+ echo ::endgroup::
78
+
79
+ - name : Save inventory file A to an artifact
80
+ uses : actions/upload-artifact@v2
81
+ with :
82
+ name : inventory_A
83
+ path : spec/fixtures/litmus_inventory.yaml
84
+
85
+ - name : ' Install PE on test cluster'
86
+ timeout-minutes : 120
87
+ run : |
88
+ buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::install_test_cluster' -- \
89
+ bundle exec bolt plan run peadm_spec::install_test_cluster \
90
+ --inventoryfile spec/fixtures/litmus_inventory.yaml \
91
+ --modulepath spec/fixtures/modules \
92
+ architecture=${{ inputs.architecture }} \
93
+ version=${{ inputs.version }}
94
+
95
+ install-cluster-B :
96
+ name : " Cluster B: PE ${{ inputs.version }} ${{ inputs.architecture }} on ${{ inputs.image }}"
31
97
runs-on : ubuntu-20.04
32
98
env :
33
99
BOLT_GEM : true
34
100
BOLT_DISABLE_ANALYTICS : true
35
101
BUILDEVENT_FILE : ' ../buildevents.txt'
36
102
LANG : ' en_US.UTF-8'
37
- strategy :
38
- fail-fast : false
39
- matrix :
40
- architecture :
41
- - " ${{ github.event.inputs.architecture }}"
42
- version :
43
- - " ${{ github.event.inputs.version }}"
44
- image :
45
- - " ${{ github.event.inputs.image }}"
46
103
47
104
steps :
48
105
- name : ' Start SSH session'
@@ -52,18 +109,6 @@ jobs:
52
109
NGROK_AUTH_TOKEN : ${{ secrets.NGROK_AUTH_TOKEN }}
53
110
SSH_PASS : ${{ secrets.SSH_PASS }}
54
111
55
- - name : " Honeycomb: Start recording"
56
- uses : puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
57
- with :
58
- apikey : ${{ env.HONEYCOMB_WRITEKEY }}
59
- dataset : ${{ env.HONEYCOMB_DATASET }}
60
- job-status : ${{ job.status }}
61
-
62
- - name : " Honeycomb: Start first step"
63
- run : |
64
- echo STEP_ID=setup-test-cluster >> $GITHUB_ENV
65
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
66
-
67
112
- name : " Checkout Source"
68
113
uses : actions/checkout@v2
69
114
@@ -80,15 +125,6 @@ jobs:
80
125
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
81
126
echo ::endgroup::
82
127
83
- - name : " Honeycomb: Record environment setup time"
84
- if : ${{ always() }}
85
- run : |
86
- echo ::group::honeycomb
87
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Set up environment'
88
- echo STEP_ID=${{ matrix.architecture }}-${{ matrix.image }}-provision >> $GITHUB_ENV
89
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
90
- echo ::endgroup::
91
-
92
128
- name : ' Provision test cluster'
93
129
timeout-minutes : 15
94
130
run : |
@@ -105,8 +141,8 @@ jobs:
105
141
bundle exec bolt plan run peadm_spec::provision_test_cluster \
106
142
--modulepath spec/fixtures/modules \
107
143
provider=provision_service \
108
- image=${{ matrix .image }} \
109
- architecture=${{ matrix .architecture }}
144
+ image=${{ inputs .image }} \
145
+ architecture=${{ inputs .architecture }}
110
146
echo ::endgroup::
111
147
112
148
echo ::group::info:request
@@ -117,44 +153,70 @@ jobs:
117
153
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
118
154
echo ::endgroup::
119
155
120
- - name : " Honeycomb: Record provision time"
121
- if : ${{ always() }}
122
- run : |
123
- echo ::group::honeycomb
124
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Provision test cluster'
125
- echo STEP_ID=${{ matrix.architecture }}-${{ matrix.image }}-install >> $GITHUB_ENV
126
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
127
- echo ::endgroup::
128
-
156
+ - name : Save inventory file B to an artifact
157
+ uses : actions/upload-artifact@v2
158
+ with :
159
+ name : inventory_A
160
+ path : spec/fixtures/litmus_inventory.yaml
161
+
129
162
- name : ' Install PE on test cluster'
130
163
timeout-minutes : 120
131
164
run : |
132
165
buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::install_test_cluster' -- \
133
166
bundle exec bolt plan run peadm_spec::install_test_cluster \
134
167
--inventoryfile spec/fixtures/litmus_inventory.yaml \
135
168
--modulepath spec/fixtures/modules \
136
- architecture=${{ matrix.architecture }} \
137
- version=${{ matrix.version }}
169
+ architecture=${{ inputs.architecture }} \
170
+ version=${{ inputs.version }}
171
+
172
+ test-backup-restore :
173
+ runs-on : ubuntu-20.04
174
+ env :
175
+ BOLT_GEM : true
176
+ BOLT_DISABLE_ANALYTICS : true
177
+ BUILDEVENT_FILE : ' ../buildevents.txt'
178
+ LANG : ' en_US.UTF-8'
179
+ needs : [install-cluster-A, install-cluster-B]
138
180
139
- - name : " Honeycomb: Record install time"
140
- if : ${{ always() }}
181
+ steps :
182
+ - name : ' Start SSH session'
183
+ if : ${{ github.event.inputs.ssh-debugging == 'true' }}
184
+ uses : luchihoratiu/debug-via-ssh@main
185
+ with :
186
+ NGROK_AUTH_TOKEN : ${{ secrets.NGROK_AUTH_TOKEN }}
187
+ SSH_PASS : ${{ secrets.SSH_PASS }}
188
+
189
+ - name : " Checkout Source"
190
+ uses : actions/checkout@v2
191
+
192
+ - name : " Activate Ruby 2.7"
193
+ uses : ruby/setup-ruby@v1
194
+ with :
195
+ ruby-version : " 2.7"
196
+ bundler-cache : true
197
+
198
+ - name : Download artifacts
199
+ uses : actions/download-artifact@v3
200
+ with :
201
+ path : spec/fixtures/
202
+
203
+ - name : perform PE backup of cluster A
204
+ timeout-minutes : 120
141
205
run : |
142
- echo ::group::honeycomb
143
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Install PE on test cluster'
144
- echo STEP_ID=${{ matrix.architecture }}-${{ matrix.image }}-tear_down >> $GITHUB_ENV
145
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
146
- echo ::endgroup::
206
+ buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::test_backup' -- \
207
+ bundle exec bolt plan run peadm_spec::test_backup \
208
+ --inventoryfile spec/fixtures/inventory_A/litmus_inventory.yaml \
209
+ --modulepath spec/fixtures/modules
147
210
148
- - name : ' Wait as long as the file ${HOME}/ pause file is present'
149
- if : ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
211
+ - name : Wait while the pause file is present
212
+ if : ${{ github.event.inputs.ssh-debugging == 'true' }}
150
213
run : |
151
- while [ -f "${HOME}/pause" ] ; do
152
- echo "${HOME}/pause present, sleeping for 60 seconds..."
153
- sleep 60
154
- done
155
- echo "${HOME}/pause absent, continuing workflow."
214
+ while [ -f pause ]; do
215
+ echo "Waiting for pause file to be removed"
216
+ sleep 10
217
+ done
156
218
157
- - name : ' Tear down test cluster'
219
+ - name : ' Tear down cluster A '
158
220
if : ${{ always() }}
159
221
continue-on-error : true
160
222
run : |
@@ -168,9 +230,17 @@ jobs:
168
230
echo ::endgroup::
169
231
fi
170
232
171
- - name : " Honeycomb: Record tear down time "
233
+ - name : ' Tear down cluster B '
172
234
if : ${{ always() }}
235
+ continue-on-error : true
173
236
run : |
174
- echo ::group::honeycomb
175
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Tear down test cluster'
176
- echo ::endgroup::
237
+ if [ -f spec/fixtures/litmus_inventory.yaml ]; then
238
+ echo ::group::tear_down
239
+ buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
240
+ echo ::endgroup::
241
+
242
+ echo ::group::info:request
243
+ cat request.json || true; echo
244
+ echo ::endgroup::
245
+ fi
246
+
0 commit comments