aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-05-03 17:06:06 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-05-03 19:29:42 -0700
commit7f114f5e27b5565fb3923eff9ad1bd6955ce1844 (patch)
treec0d74cf998f5569f64f09e0dc7b1d007a64b01a0 /version-manifest/src/main/scripts
parentc41cad9bcb624f8ea42f63e917d6155e7db18129 (diff)
Verify that docker manifest images exist in nexus3
Add enforcement check to ensure that all docker images specified in the manifest can actually be found on nexus3. Change-Id: I49ebc60a50cbb9f36f6e06d2d69c39cfeeacfcde Issue-ID: INT-488 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-xversion-manifest/src/main/scripts/check-docker-manifest.sh21
-rwxr-xr-xversion-manifest/src/main/scripts/check-sorted.sh2
2 files changed, 22 insertions, 1 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..9064c836d
--- /dev/null
+++ b/version-manifest/src/main/scripts/check-docker-manifest.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [ -z "$WORKSPACE" ]; then
+ export WORKSPACE=`git rev-parse --show-toplevel`
+fi
+
+NEXUS_PREFIX="https://nexus3.onap.org/repository/docker.public/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[]')
+ echo "$tags" | grep -q "^$tag\$"
+ if [ $? -ne 0 ]; then
+ echo "[ERROR] $image:$tag not found"
+ echo "$tags" | sed 's/^/ /'
+ (( err++ ))
+ fi
+done
+exit $err
diff --git a/version-manifest/src/main/scripts/check-sorted.sh b/version-manifest/src/main/scripts/check-sorted.sh
index d926409f4..fa120f399 100755
--- a/version-manifest/src/main/scripts/check-sorted.sh
+++ b/version-manifest/src/main/scripts/check-sorted.sh
@@ -3,7 +3,7 @@ LC_ALL=C sort -c $1
retval=$?
if [ $retval -ne 0 ]; then
echo
- echo "ERROR: $1 is not properly sorted. Please sort it with the following commands:"
+ echo "[ERROR] $1 is not properly sorted. Please sort it with the following commands:"
echo
echo " LC_ALL=C sort < $1 > $1.tmp"
echo " mv $1.tmp $1"