From: garciadeblas Date: Wed, 25 Sep 2024 14:36:24 +0000 (+0200) Subject: Update patch_module to allow push to ttl.sh X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F14601%2F1;p=osm%2Fdevops.git Update patch_module to allow push to ttl.sh Change-Id: Iab5ac29525145bb05edf0ec4b437b135faf464c1 Signed-off-by: garciadeblas --- diff --git a/tools/patch_module.sh b/tools/patch_module.sh index fb697acf..365bb426 100755 --- a/tools/patch_module.sh +++ b/tools/patch_module.sh @@ -18,8 +18,12 @@ if [ $# -ne 2 ]; then echo "Usage $0 " - echo "Example: $0 ro 2" - echo "Example: $0 lcm 5" + echo " Example: $0 ro 2" + echo " Will import image in containerd local registry as opensourcemano/ro:devel-2" + echo " Example: $0 lcm 5" + echo " Will import image in containerd local registry as opensourcemano/lcm:devel-5" + echo " Example: $0 osm-krm-functions 24h" + echo " (when tag_number is '[0-9]+h') Will push the image to ttl.sh/osm-krm-functions-devel:24h" exit 1 fi @@ -27,6 +31,16 @@ MODULE_NAME="$1" TAG_NUMBER="$2" set -x + +if [[ "${TAG_NUMBER}" =~ ^[0-9]+h$ ]]; then + IMAGE_NAME="ttl.sh/${MODULE_NAME}-devel:${TAG_NUMBER}" + docker tag opensourcemano/${MODULE_NAME}:devel ${IMAGE_NAME} + docker push ${IMAGE_NAME} + exit 0 +else + echo "Image will be imported locally" +fi + IMAGE_NAME="opensourcemano/${MODULE_NAME}:devel-${TAG_NUMBER}" docker tag opensourcemano/${MODULE_NAME}:devel ${IMAGE_NAME} IMAGE_FILE="${MODULE_NAME}-devel-${TAG_NUMBER}.tar.gz"