Publish unique docker snapshots 74/142674/2
authorFiete Ostkamp <fiete.ostkamp@telekom.de>
Sun, 7 Dec 2025 14:42:25 +0000 (15:42 +0100)
committerFiete Ostkamp <fiete.ostkamp@telekom.de>
Sun, 7 Dec 2025 14:45:32 +0000 (15:45 +0100)
- also publish a docker tag that is unique
  by including the timestamp
- this allows testing specific snapshots of
  a version to be released

Issue-ID: MULTICLOUD-1534
Change-Id: I688873c744964a545d21e8f07016154d603c914d
Signed-off-by: Fiete Ostkamp <fiete.ostkamp@telekom.de>
deployments/build.sh

index 2f3c97b..4f6c264 100755 (executable)
@@ -57,12 +57,18 @@ function _build_docker {
 }
 
 function _push_image {
+    local timestamp=$(date -u +%Y%m%dT%H%M%SZ)
     local tag_name=${IMAGE_NAME}:${1:-latest}
+    local tag_name_with_timestamp=${tag_name}-${timestamp}
 
-    echo "Start push {$tag_name}"
-    docker push ${IMAGE_NAME}:latest
+    echo "Pushing ${tag_name}"
     docker tag ${IMAGE_NAME}:latest ${tag_name}
     docker push ${tag_name}
+
+    docker tag ${IMAGE_NAME}:latest ${tag_name_with_timestamp}
+
+    echo "Pushing ${tag_name_with_timestamp}"
+    docker push ${tag_name_with_timestamp}
 }
 
 if [[ -n "${JENKINS_HOME+x}" ]]; then