blob: 61eb5a2a9caaa6eb8ae4b702e40ce47c01aa4854 [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
13NEXUS_PREFIX="https://nexus3.onap.org/repository/docker.public/v2"
14
15err=0
16for line in $(tail -n +2 $1); do
17 image=$(echo $line | cut -d , -f 1)
18 tag=$(echo $line | cut -d , -f 2)
19 tags=$(curl -s $NEXUS_PREFIX/$image/tags/list | jq -r '.tags[]')
20 echo "$tags" | grep -q "^$tag\$"
21 if [ $? -ne 0 ]; then
22 echo "[ERROR] $image:$tag not found"
23 echo "$tags" | sed 's/^/ /'
24 (( err++ ))
25 fi
26done
27exit $err