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 |
Gary Wu | 6042b94 | 2018-06-14 10:09:22 -0700 | [diff] [blame] | 4 | echo This script checks docker-manifest.csv to verify that the specified versions have been released in nexus3 |
Gary Wu | ce4fcc0 | 2018-05-07 15:09:28 -0700 | [diff] [blame] | 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 | |
Gary Wu | af169aa | 2018-05-09 19:34:30 -0700 | [diff] [blame] | 13 | NEXUS_PUBLIC_PREFIX="https://nexus3.onap.org/repository/docker.public/v2" |
| 14 | NEXUS_RELEASE_PREFIX="https://nexus3.onap.org/repository/docker.release/v2" |
Gary Wu | 7f114f5 | 2018-05-03 17:06:06 -0700 | [diff] [blame] | 15 | |
| 16 | err=0 |
| 17 | for line in $(tail -n +2 $1); do |
| 18 | image=$(echo $line | cut -d , -f 1) |
| 19 | tag=$(echo $line | cut -d , -f 2) |
Gary Wu | af169aa | 2018-05-09 19:34:30 -0700 | [diff] [blame] | 20 | |
Gary Wu | 2f55cbd | 2018-06-06 14:52:29 -0700 | [diff] [blame] | 21 | tags=$(curl -s $NEXUS_RELEASE_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null) |
Gary Wu | 7f114f5 | 2018-05-03 17:06:06 -0700 | [diff] [blame] | 22 | echo "$tags" | grep -q "^$tag\$" |
| 23 | if [ $? -ne 0 ]; then |
Gary Wu | 2f55cbd | 2018-06-06 14:52:29 -0700 | [diff] [blame] | 24 | echo "[ERROR] $image:$tag not released" |
Gary Wu | af169aa | 2018-05-09 19:34:30 -0700 | [diff] [blame] | 25 | #echo "$tags" | sed 's/^/ /' |
Gary Wu | 7f114f5 | 2018-05-03 17:06:06 -0700 | [diff] [blame] | 26 | (( err++ )) |
Gary Wu | d39d077 | 2018-10-09 13:36:57 -0700 | [diff] [blame] | 27 | else |
| 28 | echo "[INFO] $image:$tag OK" |
Gary Wu | 7f114f5 | 2018-05-03 17:06:06 -0700 | [diff] [blame] | 29 | fi |
| 30 | done |
| 31 | exit $err |