2020 description : ' Boolean; whether or not to pause for ssh debugging'
2121 required : true
2222 default : ' false'
23+ log_level :
24+ description : ' Bolt log level'
25+ required : false
26+ default : ' debug'
2327
2428env :
2529 HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
@@ -37,13 +41,12 @@ jobs:
3741 strategy :
3842 fail-fast : false
3943 matrix :
40- architecture :
41- - " extra-large-with-dr-and-spare-replica"
4244 version :
4345 - " ${{ github.event.inputs.version }}"
4446 image :
4547 - " ${{ github.event.inputs.image }}"
46-
48+ architecture :
49+ - " extra-large-with-dr"
4750 steps :
4851 - name : ' Start SSH session'
4952 if : ${{ github.event.inputs.ssh-debugging == 'true' }}
8992 echo STEP_START=$(date +%s) >> $GITHUB_ENV
9093 echo ::endgroup::
9194
92- - name : ' Provision test cluster (specified architecture with added DR )'
95+ - name : ' Provision test cluster (XL with spare replica )'
9396 timeout-minutes : 15
9497 run : |
9598 echo ::group::prepare
@@ -106,13 +109,7 @@ jobs:
106109 --modulepath spec/fixtures/modules \
107110 provider=provision_service \
108111 image=${{ matrix.image }} \
109- architecture=${{ matrix.architecture }}-with-dr
110- buildevents cmd $TRACE_ID $STEP_ID 'bolt task run provision::provision_service' -- \
111- bundle exec bolt bolt task run provision::provision_service \
112- --modulepath spec/fixtures/modules \
113- action=provision
114- platform=${{ matrix.image }} \
115- vars="role: primary"
112+ architecture=${{ matrix.architecture }}-and-spare-replica
116113 echo ::endgroup::
117114
118115 echo ::group::info:request
@@ -136,7 +133,7 @@ jobs:
136133 timeout-minutes : 120
137134 run : |
138135 buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::install_test_cluster' -- \
139- bundle exec bolt plan run peadm_spec::install_test_cluster \
136+ bundle exec bolt plan run peadm_spec::install_test_cluster --log_level ${{ github.event.inputs.log_level }} \
140137 --inventoryfile spec/fixtures/litmus_inventory.yaml \
141138 --modulepath spec/fixtures/modules \
142139 architecture=${{ matrix.architecture }} \
@@ -154,11 +151,9 @@ jobs:
154151 - name : ' Perform failover'
155152 run : |
156153 buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::perform_failover' -- \
157- bundle exec bolt plan run peadm_spec::perform_failover \
154+ bundle exec bolt plan run peadm_spec::perform_failover --log_level ${{ github.event.inputs.log_level }} \
158155 --inventoryfile spec/fixtures/litmus_inventory.yaml \
159- --modulepath spec/fixtures/modules \
160- platform=${{ matrix.image }} \
161- vars="role: primary"
156+ --modulepath spec/fixtures/modules
162157
163158 - name : " Honeycomb: Record falover time"
164159 if : ${{ always() }}
@@ -178,20 +173,36 @@ jobs:
178173 done
179174 echo "${HOME}/pause absent, continuing workflow."
180175
176+ - name : Set up yq
177+ uses : frenck/action-setup-yq@v1
178+ with :
179+ version : v4.30.5
180+
181+ - name : ' Update inventory'
182+ run : |
183+ # Remove failed primary
184+ yq -i 'del(.groups[].targets[] | select(.vars.role == "primary"))' spec/fixtures/litmus_inventory.yaml
185+ # Swap primary and replica nodes
186+ sed -i.sedbak 's/primary/__tmp__/;s/spare-replica/__tmp2__/;s/replica/primary/;s/__tmp__/replica/;s/__tmp2__/replica/' \
187+ spec/fixtures/litmus_inventory.yaml
188+ echo ::group::info:inventory
189+ sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
190+ echo ::endgroup::
191+
181192 - name : ' Upgrade PE on test cluster'
182- if : ${{ always () && github.event.inputs.version_to_upgrade != '' }}
193+ if : ${{ success () && github.event.inputs.version_to_upgrade != '' }}
183194 timeout-minutes : 120
184195 run : |
185196 buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::upgrade_test_cluster' -- \
186- bundle exec bolt plan run peadm_spec::upgrade_test_cluster \
197+ bundle exec bolt plan run peadm_spec::upgrade_test_cluster --log_level ${{ github.event.inputs.log_level }} \
187198 --inventoryfile spec/fixtures/litmus_inventory.yaml \
188199 --modulepath spec/fixtures/modules \
189- architecture='extra-large-with-dr' \
200+ architecture=${{ matrix.architecture }} \
190201 download_mode='direct' \
191- version=${{ matrix .version_to_upgrade }}
202+ version=${{ github.event.inputs .version_to_upgrade }}
192203
193204 - name : " Honeycomb: Record upgrade time"
194- if : ${{ always () && github.event.inputs.version_to_upgrade != '' }}
205+ if : ${{ success () && github.event.inputs.version_to_upgrade != '' }}
195206 run : |
196207 echo ::group::honeycomb
197208 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Upgrade PE on test cluster'
0 commit comments