if [ $# -ne 2 ]; then
echo "Usage $0 <module> <tag_number>"
- 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
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"