Skip to content

Commit 01ddd87

Browse files
fix(ci): revert script changes causing workflow failures (#8133)
* fix(ci): revert script changes causing workflow failures * fix(ci): typo * fix(ci): use correct `DISK_OPTION` approach * fix(ci): revert find cached state disks * fix(ci): revert to previous `gcp-get-cached-disks.sh` script * chore: reduce diff and add TODO
1 parent 45e3f5e commit 01ddd87

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/sub-find-cached-disks.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,33 @@ jobs:
6969
env:
7070
GITHUB_WORKSPACE: ${{ env.GITHUB_WORKSPACE }}
7171
NETWORK: ${{ env.NETWORK }} # use lowercase version from env, not input
72+
# TODO: Use the `gcp-get-available-disks.sh` script instead of the inline script,
73+
# as this is crashing. And it might related to the returned JSON values.
7274
run: |
73-
./.github/workflows/scripts/gcp-get-available-disks.sh
75+
# ./.github/workflows/scripts/gcp-get-available-disks.sh
76+
LOCAL_STATE_VERSION=$(grep -oE "DATABASE_FORMAT_VERSION: .* [0-9]+" "$GITHUB_WORKSPACE/zebra-state/src/constants.rs" | grep -oE "[0-9]+" | tail -n1)
77+
echo "STATE_VERSION: $LOCAL_STATE_VERSION"
78+
LWD_TIP_DISK=$(gcloud compute images list --filter="status=READY AND name~lwd-cache-.+-[0-9a-f]+-v${LOCAL_STATE_VERSION}-${NETWORK}-tip" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
79+
if [[ -z "$LWD_TIP_DISK" ]]; then
80+
echo "No TIP disk found for lightwalletd on network: ${NETWORK}"
81+
echo "lwd_tip_disk=${{ toJSON(false) }}" >> "$GITHUB_OUTPUT"
82+
else
83+
echo "Disk: $LWD_TIP_DISK"
84+
echo "lwd_tip_disk=${{ toJSON(true) }}" >> "$GITHUB_OUTPUT"
85+
fi
86+
ZEBRA_TIP_DISK=$(gcloud compute images list --filter="status=READY AND name~zebrad-cache-.+-[0-9a-f]+-v${LOCAL_STATE_VERSION}-${NETWORK}-tip" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
87+
if [[ -z "$ZEBRA_TIP_DISK" ]]; then
88+
echo "No TIP disk found for Zebra on network: ${NETWORK}"
89+
echo "zebra_tip_disk=${{ toJSON(false) }}" >> "$GITHUB_OUTPUT"
90+
else
91+
echo "Disk: $ZEBRA_TIP_DISK"
92+
echo "zebra_tip_disk=${{ toJSON(true) }}" >> "$GITHUB_OUTPUT"
93+
fi
94+
ZEBRA_CHECKPOINT_DISK=$(gcloud compute images list --filter="status=READY AND name~zebrad-cache-.+-[0-9a-f]+-v${LOCAL_STATE_VERSION}-${NETWORK}-checkpoint" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
95+
if [[ -z "$ZEBRA_CHECKPOINT_DISK" ]]; then
96+
echo "No CHECKPOINT disk found for Zebra on network: ${NETWORK}"
97+
echo "zebra_checkpoint_disk=${{ toJSON(false) }}" >> "$GITHUB_OUTPUT"
98+
else
99+
echo "Disk: $ZEBRA_CHECKPOINT_DISK"
100+
echo "zebra_checkpoint_disk=${{ toJSON(true) }}" >> "$GITHUB_OUTPUT"
101+
fi

0 commit comments

Comments
 (0)