blob: cff76ef860462f2840cc79d068db045e5854e5cb [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
Gary Wu6042b942018-06-14 10:09:22 -07004 echo This script checks docker-manifest.csv to verify that the specified versions have been released in nexus3
Gary Wuce4fcc02018-05-07 15:09:28 -07005 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
Gary Wu2f55cbd2018-06-06 14:52:29 -070021 tags=$(curl -s $NEXUS_RELEASE_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
Gary Wu2f55cbd2018-06-06 14:52:29 -070024 echo "[ERROR] $image:$tag not released"
Gary Wuaf169aa2018-05-09 19:34:30 -070025 #echo "$tags" | sed 's/^/ /'
Gary Wu7f114f52018-05-03 17:06:06 -070026 (( err++ ))
Gary Wud39d0772018-10-09 13:36:57 -070027 else
28 echo "[INFO] $image:$tag OK"
Gary Wu7f114f52018-05-03 17:06:06 -070029 fi
30done
31exit $err