Skip to content

Commit e1a0c89

Browse files
committed
More tags based on latest version
1 parent dd1ecf0 commit e1a0c89

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARG package
1010
ARG package_version
1111

1212
# Only add build tools for alpine image. The ubuntu based images have build tools already.
13+
# This command fails with a warning on Ubuntu (sh) and succeeds without issue on alpine (bash).
1314
RUN if [[ "$build_target" == *"alpine" ]] ; then apk add build-base ; fi
1415

1516
# Install packaer and build all dependencies.

scripts/build_and_push.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,18 @@ IMAGE_LOCATION=$REGISTRY/$IMAGE_REPOSITORY
5353
TAG="$IMAGE_LOCATION:py${PUBLISH_TARGET}-${PACKAGE_VERSION}"
5454

5555
TAGS=" -t $TAG"
56+
57+
# For the latest version we do extra stuff.
5658
if [[ ! -z $PACKAGE_LATEST_VERSION ]] && [[ $PACKAGE_LATEST_VERSION = $PACKAGE_VERSION ]]; then
5759
TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST"
60+
61+
VERSION_SHORTER=$(echo $PACKAGE_VERSION | | cut -d"." -f1,2)
62+
TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}"
63+
64+
VERSION_SHORTERER=$(echo $PACKAGE_VERSION | | cut -d"." -f1)
65+
if [[ $VERSION_SHORTERER != "0" ]]; then
66+
TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}"
67+
fi
5868
fi
5969

6070

0 commit comments

Comments
 (0)