Allow only released docker images in the manifest 33/50833/1 v2.0.0
authorGary Wu <gary.i.wu@huawei.com>
Wed, 6 Jun 2018 21:52:29 +0000 (14:52 -0700)
committerGary Wu <gary.i.wu@huawei.com>
Wed, 6 Jun 2018 21:53:06 +0000 (14:53 -0700)
Change-Id: I8ebc0e6a8b923a4b9c81403ade7248a4396b179e
Issue-ID: INT-504
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
version-manifest/pom.xml
version-manifest/src/main/scripts/check-docker-manifest.sh

index daa957e..89fb1b1 100644 (file)
             </configuration>
           </execution>
           <execution>
-            <id>check-docker-images-exist</id>
+            <id>check-docker-images-released</id>
             <phase>validate</phase>
             <goals>
               <goal>exec</goal>
index 26e63b8..6aa2374 100755 (executable)
@@ -18,20 +18,12 @@ 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_PUBLIC_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null)
+    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 "[ERROR] $image:$tag not found"
+        echo "[ERROR] $image:$tag not released"
         #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