Warn of unreleased docker images in manifest 39/46939/1
authorGary Wu <gary.i.wu@huawei.com>
Thu, 10 May 2018 02:34:30 +0000 (19:34 -0700)
committerGary Wu <gary.i.wu@huawei.com>
Thu, 10 May 2018 02:36:03 +0000 (19:36 -0700)
Change-Id: I41536f020bd787a0c4a18f854c8238243eaad2d6
Issue-ID: INT-495
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
version-manifest/src/main/scripts/check-docker-manifest.sh

index 61eb5a2..26e63b8 100755 (executable)
@@ -10,18 +10,28 @@ if [ -z "$WORKSPACE" ]; then
     export WORKSPACE=`git rev-parse --show-toplevel`
 fi
 
-NEXUS_PREFIX="https://nexus3.onap.org/repository/docker.public/v2"
+NEXUS_PUBLIC_PREFIX="https://nexus3.onap.org/repository/docker.public/v2"
+NEXUS_RELEASE_PREFIX="https://nexus3.onap.org/repository/docker.release/v2"
 
 err=0
 for line in $(tail -n +2 $1); do
     image=$(echo $line | cut -d , -f 1)
     tag=$(echo $line | cut -d , -f 2)
-    tags=$(curl -s $NEXUS_PREFIX/$image/tags/list | jq -r '.tags[]')
+
+    tags=$(curl -s $NEXUS_PUBLIC_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null)
     echo "$tags" | grep -q "^$tag\$"
     if [ $? -ne 0 ]; then
         echo "[ERROR] $image:$tag not found"
-        echo "$tags" | sed 's/^/  /'
+        #echo "$tags" | sed 's/^/  /'
         (( err++ ))
+
+    else
+        tags=$(curl -s $NEXUS_RELEASE_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null)
+        echo "$tags" | grep -q "^$tag\$"
+        if [ $? -ne 0 ]; then
+            echo "[WARN] $image:$tag not released"
+            #echo "$tags" | sed 's/^/  /'
+        fi
     fi
 done
 exit $err