blob: 26e63b82d6feaade5b3d4fb7b1097e504c17e563 [file] [log] [blame]
Gary Wu7f114f52018-05-03 17:06:06 -07001#!/bin/bash
2
Gary Wuce4fcc02018-05-07 15:09:28 -07003if [ "$#" -ne 1 ]; then
4 echo This script checks docker-manifest.csv to verify that the specified versions exist in nexus3
5 echo "$0 <docker-manifest.csv>"
6 exit 1
7fi
8
Gary Wu7f114f52018-05-03 17:06:06 -07009if [ -z "$WORKSPACE" ]; then
10 export WORKSPACE=`git rev-parse --show-toplevel`
11fi
12
Gary Wuaf169aa2018-05-09 19:34:30 -070013NEXUS_PUBLIC_PREFIX="https://nexus3.onap.org/repository/docker.public/v2"
14NEXUS_RELEASE_PREFIX="https://nexus3.onap.org/repository/docker.release/v2"
Gary Wu7f114f52018-05-03 17:06:06 -070015
16err=0
17for line in $(tail -n +2 $1); do
18 image=$(echo $line | cut -d , -f 1)
19 tag=$(echo $line | cut -d , -f 2)
Gary Wuaf169aa2018-05-09 19:34:30 -070020
21 tags=$(curl -s $NEXUS_PUBLIC_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null)
Gary Wu7f114f52018-05-03 17:06:06 -070022 echo "$tags" | grep -q "^$tag\$"
23 if [ $? -ne 0 ]; then
24 echo "[ERROR] $image:$tag not found"
Gary Wuaf169aa2018-05-09 19:34:30 -070025 #echo "$tags" | sed 's/^/ /'
Gary Wu7f114f52018-05-03 17:06:06 -070026 (( err++ ))
Gary Wuaf169aa2018-05-09 19:34:30 -070027
28 else
29 tags=$(curl -s $NEXUS_RELEASE_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null)
30 echo "$tags" | grep -q "^$tag\$"
31 if [ $? -ne 0 ]; then
32 echo "[WARN] $image:$tag not released"
33 #echo "$tags" | sed 's/^/ /'
34 fi
Gary Wu7f114f52018-05-03 17:06:06 -070035 fi
36done
37exit $err