Skip to content

Commit 2b7fd6f

Browse files
committed
fix(workflow): correct legacy compiler selection in test-legacy-upgrade.yaml
- Replace `head -n 2` with `sed -n 2p` for accurate selection of the second compiler
1 parent 957f060 commit 2b7fd6f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/test-legacy-upgrade.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ on:
3131
required: true
3232
default: 'false'
3333
jobs:
34-
convert_compiler:
35-
name: Convert compilers to legacy
34+
upgrade_with_legacy_compilers:
35+
name: Upgrade PE with legacy compilers
3636
runs-on: ubuntu-20.04
3737
env:
3838
BOLT_GEM: true
@@ -96,14 +96,14 @@ jobs:
9696
run: |
9797
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
9898
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
99-
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
99+
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p)
100100
replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml)
101-
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
101+
echo -n '{ "download_mode": "direct", "primary_host": "'$primary'", "replica_host": "'$replica'", "legacy_compilers": ["'$legacy_compiler'"], "compiler_hosts": ["'$compiler'"], "version": "2023.7.0", "console_password": "'${{ secrets.CONSOLE_PASSWORD }}'" }' > params.json
102102
- name: Install PE with legacy compilers
103103
timeout-minutes: 120
104104
run: |
105105
echo ::group::params.json
106-
sed -e 's/console_password: .*/console_password: "[redacted]"/' < params.json || true
106+
jq '.console_password = "[redacted]"' params.json || true
107107
echo ::endgroup::
108108
echo ::group::install
109109
bundle exec bolt plan run peadm::install \
@@ -129,7 +129,7 @@ jobs:
129129
echo ::group::get_peadm_config
130130
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
131131
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
132-
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
132+
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p)
133133
bundle exec bolt task run peadm::get_peadm_config \
134134
--targets $primary \
135135
--inventoryfile spec/fixtures/litmus_inventory.yaml \
@@ -150,13 +150,13 @@ jobs:
150150
run: |
151151
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
152152
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
153-
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
153+
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p)
154154
replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml)
155155
echo -n '{ "primary_host": "'$primary'", "replica_host": "'$replica'", "compiler_hosts": ["'$compiler'", "'$legacy_compiler'"], "version": "2023.8.0"}' > upgrade_params.json
156156
- name: Upgrade PE with legacy compilers
157157
run: |
158158
echo ::group::upgrade_params.json
159-
echo upgrade_params.json
159+
cat upgrade_params.json
160160
echo ::endgroup::
161161
echo ::group::upgrade
162162
bundle exec bolt plan run peadm::upgrade \
@@ -174,7 +174,7 @@ jobs:
174174
echo ::group::get_peadm_config
175175
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
176176
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
177-
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
177+
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p)
178178
bundle exec bolt task run peadm::get_peadm_config \
179179
--targets $primary \
180180
--inventoryfile spec/fixtures/litmus_inventory.yaml \

0 commit comments

Comments
 (0)