Fix cloudbuild step. (#7131)
Co-authored-by: Shreya Keshive <skeshive@gmail.com>
This commit is contained in:
parent
231576426c
commit
47417ec05e
1 changed files with 3 additions and 7 deletions
|
|
@ -26,15 +26,11 @@ steps:
|
||||||
- |-
|
- |-
|
||||||
SHELL_TAG_NAME="$TAG_NAME"
|
SHELL_TAG_NAME="$TAG_NAME"
|
||||||
FINAL_TAG="$SHORT_SHA" # Default to SHA
|
FINAL_TAG="$SHORT_SHA" # Default to SHA
|
||||||
if [[ "$$SHELL_TAG_NAME" == *"-nightly"* ]]; then
|
if [[ "$$SHELL_TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
|
||||||
echo "Nightly release detected."
|
echo "Release detected."
|
||||||
FINAL_TAG="$${SHELL_TAG_NAME#v}"
|
|
||||||
# Also escape the variable in the regex match
|
|
||||||
elif [[ "$$SHELL_TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
||||||
echo "Official release detected."
|
|
||||||
FINAL_TAG="$${SHELL_TAG_NAME#v}"
|
FINAL_TAG="$${SHELL_TAG_NAME#v}"
|
||||||
else
|
else
|
||||||
echo "Development/RC release detected. Using commit SHA as tag."
|
echo "Development release detected. Using commit SHA as tag."
|
||||||
fi
|
fi
|
||||||
echo "Determined image tag: $$FINAL_TAG"
|
echo "Determined image tag: $$FINAL_TAG"
|
||||||
echo "$$FINAL_TAG" > /workspace/image_tag.txt
|
echo "$$FINAL_TAG" > /workspace/image_tag.txt
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue