Use a generic alphabetical pattern rather than a regex group
Google Cloud doesn't seem to support regex groups.
This commit is contained in:
parent
e335d5ad86
commit
970afe7b17
|
@ -215,15 +215,17 @@ jobs:
|
||||||
# Try to find an image generated from the main branch
|
# Try to find an image generated from the main branch
|
||||||
# Fields are listed in the "Create image from state disk" step
|
# Fields are listed in the "Create image from state disk" step
|
||||||
#
|
#
|
||||||
# TODO: require ${NETWORK} in the name after PR #4391 merges to main and runs a full sync
|
# TODO: require ${NETWORK} in the name after PR #4391 merges to main, and runs a full sync
|
||||||
CACHED_DISK_NAME=$(gcloud compute images list --verbosity=debug --filter="name~${{ inputs.disk_prefix }}-main-[0-9a-f]+-v${LOCAL_STATE_VERSION}-(${NETWORK})?-${{ inputs.disk_suffix }}" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
|
# network should replace [a-z]*
|
||||||
|
CACHED_DISK_NAME=$(gcloud compute images list --verbosity=debug --filter="name~${{ inputs.disk_prefix }}-main-[0-9a-f]+-v${LOCAL_STATE_VERSION}-[a-z]*-${{ inputs.disk_suffix }}" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
|
||||||
echo "main Disk: $CACHED_DISK_NAME"
|
echo "main Disk: $CACHED_DISK_NAME"
|
||||||
|
|
||||||
if [[ -z "$CACHED_DISK_NAME" ]]; then
|
if [[ -z "$CACHED_DISK_NAME" ]]; then
|
||||||
# Try to find an image generated from any other branch
|
# Try to find an image generated from any other branch
|
||||||
#
|
#
|
||||||
# TODO: require ${NETWORK} in the name after PRs #4391 and #4385 merge to main
|
# TODO: require ${NETWORK} in the name after PRs #4391 and #4385 merge to main
|
||||||
CACHED_DISK_NAME=$(gcloud compute images list --verbosity=debug --filter="name~${{ inputs.disk_prefix }}-.+-[0-9a-f]+-v${LOCAL_STATE_VERSION}-(${NETWORK})?-${{ inputs.disk_suffix }}" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
|
# network should replace [a-z]*
|
||||||
|
CACHED_DISK_NAME=$(gcloud compute images list --verbosity=debug --filter="name~${{ inputs.disk_prefix }}-.+-[0-9a-f]+-v${LOCAL_STATE_VERSION}-[a-z]*-${{ inputs.disk_suffix }}" --format="value(NAME)" --sort-by=~creationTimestamp --limit=1)
|
||||||
echo "Disk: $CACHED_DISK_NAME"
|
echo "Disk: $CACHED_DISK_NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue