From e54f8f03bce68b2a7c7f2d586ed7974ebe3eb009 Mon Sep 17 00:00:00 2001 From: Filippo Roggi Date: Tue, 8 Aug 2023 00:01:38 +0200 Subject: [PATCH 1/2] Use lowercase repo as the docker tag GitHub Packages (just like Docker Hub) doesn't allow repos containing uppercase chars. There is also no need to use string concatenation. --- scripts/build_and_push.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build_and_push.sh b/scripts/build_and_push.sh index 038021b..41303e0 100755 --- a/scripts/build_and_push.sh +++ b/scripts/build_and_push.sh @@ -48,7 +48,7 @@ fi # Image Push location REGISTRY=${REGISTRY:-"ghcr.io"} IMAGE_REPOSITORY=${IMAGE_NAME:-$GITHUB_REPOSITORY} -IMAGE_LOCATION=$REGISTRY/$IMAGE_REPOSITORY +IMAGE_LOCATION=$(echo "$REGISTRY/$IMAGE_REPOSITORY" | tr '[:upper:]' '[:lower:]') TAG="$IMAGE_LOCATION:py${PUBLISH_TARGET}-${PACKAGE_VERSION}" @@ -56,14 +56,14 @@ TAGS=" -t $TAG" # For the latest version we do extra stuff. if [[ ! -z $PACKAGE_LATEST_VERSION ]] && [[ $PACKAGE_LATEST_VERSION = $PACKAGE_VERSION ]]; then - TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST" + TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST" VERSION_SHORTER=$(echo $PACKAGE_VERSION | cut -d"." -f1,2) - TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}" + TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}" VERSION_SHORTERER=$(echo $PACKAGE_VERSION | cut -d"." -f1) if [[ $VERSION_SHORTERER != "0" ]]; then - TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}" + TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}" fi fi From 7c7ba3c0487304d91a2e89df4ac272daa47b71b5 Mon Sep 17 00:00:00 2001 From: Filippo Roggi Date: Tue, 8 Aug 2023 01:24:50 +0200 Subject: [PATCH 2/2] String concatenation *is* needed --- scripts/build_and_push.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build_and_push.sh b/scripts/build_and_push.sh index 41303e0..4195ec7 100755 --- a/scripts/build_and_push.sh +++ b/scripts/build_and_push.sh @@ -56,14 +56,14 @@ TAGS=" -t $TAG" # For the latest version we do extra stuff. if [[ ! -z $PACKAGE_LATEST_VERSION ]] && [[ $PACKAGE_LATEST_VERSION = $PACKAGE_VERSION ]]; then - TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST" + TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST" VERSION_SHORTER=$(echo $PACKAGE_VERSION | cut -d"." -f1,2) - TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}" + TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}" VERSION_SHORTERER=$(echo $PACKAGE_VERSION | cut -d"." -f1) if [[ $VERSION_SHORTERER != "0" ]]; then - TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}" + TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}" fi fi