aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts/check-docker-manifest.sh
blob: 9064c836de7c6359db08fc88d8a6efc905869cd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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