Skip to content

Commit ee5f6c6

Browse files
author
kmova
committed
refactor(build): trim leading v from image tag
Using the github tag, docker image tags are created. As we move the github tags to semver format, the image tags will end up having a leading `v` in the tag. To keep the image tag names consistent with past releases, the leading `v` will be trimmed from the travis tag and the rest of the string will be used for image tag. Examples: 1.10.0 maps to 1.10.0 v1.10.0 maps to 1.10.0 v1.10.0-custom-RC1 maps to 1.10.0-custom-RC1 Signed-off-by: kmova <[email protected]>
1 parent abd93fb commit ee5f6c6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

buildscripts/push

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ then
8383
# Push with different tags if tagged as a release
8484
# When github is tagged with a release, then Travis will
8585
# set the release tag in env TRAVIS_TAG
86-
TagAndPushImage "${DIMAGE}" "${TRAVIS_TAG}"
86+
# Trim the `v` from the TRAVIS_TAG if it exists
87+
# Example: v1.10.0 maps to 1.10.0
88+
# Example: 1.10.0 maps to 1.10.0
89+
# Example: v1.10.0-custom maps to 1.10.0-custom
90+
TagAndPushImage "${DIMAGE}" "${TRAVIS_TAG#v}"
8791
TagAndPushImage "${DIMAGE}" "latest"
8892
fi;
8993
else
@@ -103,7 +107,8 @@ then
103107
# Push with different tags if tagged as a release
104108
# When github is tagged with a release, then Travis will
105109
# set the release tag in env TRAVIS_TAG
106-
TagAndPushImage "quay.io/${DIMAGE}" "${TRAVIS_TAG}"
110+
# Trim the `v` from the TRAVIS_TAG if it exists
111+
TagAndPushImage "quay.io/${DIMAGE}" "${TRAVIS_TAG#v}"
107112
TagAndPushImage "quay.io/${DIMAGE}" "latest"
108113
fi;
109114
else

0 commit comments

Comments
 (0)