Gary Wu | 7f114f5 | 2018-05-03 17:06:06 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Gary Wu | ce4fcc0 | 2018-05-07 15:09:28 -0700 | [diff] [blame^] | 3 | if [ "$#" -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 |
| 7 | fi |
| 8 | |
Gary Wu | 7f114f5 | 2018-05-03 17:06:06 -0700 | [diff] [blame] | 9 | if [ -z "$WORKSPACE" ]; then |
| 10 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 11 | fi |
| 12 | |
| 13 | NEXUS_PREFIX="https://nexus3.onap.org/repository/docker.public/v2" |
| 14 | |
| 15 | err=0 |
| 16 | for 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 |
| 26 | done |
| 27 | exit $err |