Skip to content

Commit bd1793e

Browse files
marquizk8s-infra-cherrypick-robot
authored andcommitted
scripts/test-infra/push-image: more robust parsing of version
If the _PULL_BASE_REF matches a release tag use that as the VERSION. This fixes a problem in cases we push multiple tags at the same time like: git push origin v0.X.Y api/nfd/v0.X.Y and the _GIT_TAG might be derived from the api/nfd/... tag.
1 parent 9ed6063 commit bd1793e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/test-infra/push-image.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
# Override VERSION if _GIT_TAG is specified. Strip 10 first characters
44
# ('vYYYYMMDD-') from _GIT_TAG in order to get a reproducible version and
55
# container image tag
6-
if [ -n "$_GIT_TAG" ]; then
7-
MAKE_VARS="VERSION=${_GIT_TAG:10}"
8-
fi
9-
if ! [[ $_PULL_BASE_REF =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
10-
MAKE_VARS="$MAKE_VARS IMAGE_EXTRA_TAG_NAMES=${_PULL_BASE_REF} CHART_EXTRA_VERSIONS=0.0.0-${_PULL_BASE_REF}"
6+
if [[ $_PULL_BASE_REF =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
7+
MAKE_VARS="VERSION=${_PULL_BASE_REF}"
8+
else
9+
MAKE_VARS="VERSION=${_GIT_TAG:10} IMAGE_EXTRA_TAG_NAMES=${_PULL_BASE_REF} CHART_EXTRA_VERSIONS=0.0.0-${_PULL_BASE_REF}"
1110
fi
1211

1312
# Authenticate in order to be able to push images

0 commit comments

Comments
 (0)