summaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts/check-docker-manifest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'version-manifest/src/main/scripts/check-docker-manifest.sh')
-rwxr-xr-xversion-manifest/src/main/scripts/check-docker-manifest.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/version-manifest/src/main/scripts/check-docker-manifest.sh b/version-manifest/src/main/scripts/check-docker-manifest.sh
new file mode 100755
index 000000000..26e63b82d
--- /dev/null
+++ b/version-manifest/src/main/scripts/check-docker-manifest.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+if [ "$#" -ne 1 ]; then
+ echo This script checks docker-manifest.csv to verify that the specified versions exist in nexus3
+ echo "$0 <docker-manifest.csv>"
+ exit 1
+fi
+
+if [ -z "$WORKSPACE" ]; then
+ export WORKSPACE=`git rev-parse --show-toplevel`
+fi
+
+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_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/^/ /'
+ (( 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