Skip to content

Commit af3c0f9

Browse files
committed
feat(workflow): add PE upgrade step with legacy compilers
- Renamed job `install` to `install_upgrade` for clarity. - Added a new step to create `upgrade_params.json` for PE upgrade. - Included a new step to upgrade PE with legacy compilers using Bolt plan. - Updated `params.json` creation to include `replica_host`.
1 parent 2d7fc6d commit af3c0f9

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/test-convert-to-legacy.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ jobs:
159159
cat request.json || true; echo
160160
echo ::endgroup::
161161
fi
162-
install:
163-
name: Install PE with legacy compilers
162+
install_upgrade:
163+
name: Install and Upgrade PE with legacy compilers
164164
runs-on: ubuntu-20.04
165165
env:
166166
BOLT_GEM: true
@@ -225,7 +225,8 @@ jobs:
225225
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
226226
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
227227
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
228-
echo -n '{ "primary_host": "'$primary'", "legacy_compilers": ["'$legacy_compiler'"], "compiler_hosts": ["'$compiler'"], "version": "2023.8.0", "console_password": "'${{ secrets.CONSOLE_PASSWORD }}'" }' > params.json
228+
replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml)
229+
echo -n '{ "primary_host": "'$primary'", "replica_host": "'$replica'", "legacy_compilers": ["'$legacy_compiler'"], "compiler_hosts": ["'$compiler'"], "version": "2023.7.0", "console_password": "'${{ secrets.CONSOLE_PASSWORD }}'" }' > params.json
229230
- name: Install PE with legacy compilers
230231
timeout-minutes: 120
231232
run: |
@@ -272,6 +273,24 @@ jobs:
272273
exit 1
273274
fi
274275
echo ::endgroup::
276+
- name: Create the upgrade params.json file
277+
run: |
278+
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
279+
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
280+
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
281+
replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml)
282+
echo -n '{ "primary_host": "'$primary'", "replica_host": "'$replica'", "compiler_hosts": ["'$compiler'", "'$legacy_compiler'"], "version": "2023.8.0"}' > upgrade_params.json
283+
- name: Upgrade PE with legacy compilers
284+
run: |
285+
echo ::group::upgrade_params.json
286+
echo upgrade_params.json
287+
echo ::endgroup::
288+
echo ::group::upgrade
289+
bundle exec bolt plan run peadm::upgrade \
290+
--inventoryfile spec/fixtures/litmus_inventory.yaml \
291+
--modulepath spec/fixtures/modules \
292+
--params @upgrade_params.json
293+
echo ::endgroup::
275294
- name: Tear down test cluster
276295
if: ${{ always() }}
277296
continue-on-error: true

0 commit comments

Comments
 (0)