diff options
author | 2018-06-14 10:09:22 -0700 | |
---|---|---|
committer | 2018-06-14 10:09:56 -0700 | |
commit | 6042b9423ca59ed2fe951ea88ba564adf9218074 (patch) | |
tree | 77a3c614218d722256e33fad60369c13ada40e8c /version-manifest/src/main/scripts | |
parent | 8994d6625b3597fd0b691743faac4d6739ccf38f (diff) |
Add verify job for staging manifest
Change-Id: I857f992069424e74e8b106bf8455280e8111c060
Issue-ID: INT-533
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-x | version-manifest/src/main/scripts/check-docker-manifest-staging.sh | 29 | ||||
-rwxr-xr-x | version-manifest/src/main/scripts/check-docker-manifest.sh | 2 |
2 files changed, 30 insertions, 1 deletions
diff --git a/version-manifest/src/main/scripts/check-docker-manifest-staging.sh b/version-manifest/src/main/scripts/check-docker-manifest-staging.sh new file mode 100755 index 000000000..e37029e93 --- /dev/null +++ b/version-manifest/src/main/scripts/check-docker-manifest-staging.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo This script checks docker-manifest-staging.csv to verify that the specified versions exist in nexus3 + echo "$0 <docker-manifest-staging.csv>" + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +NEXUS_PUBLIC_PREFIX="https://nexus3.onap.org/repository/docker.public/v2" +NEXUS_RELEASE_PREFIX="https://nexus3.onap.org/repository/docker.release/v2" + +err=0 +for line in $(tail -n +2 $1); do + image=$(echo $line | cut -d , -f 1) + tag=$(echo $line | cut -d , -f 2) + + tags=$(curl -s $NEXUS_PUBLIC_PREFIX/$image/tags/list | jq -r '.tags[]' 2> /dev/null) + echo "$tags" | grep -q "^$tag\$" + if [ $? -ne 0 ]; then + echo "[ERROR] $image:$tag not found" + #echo "$tags" | sed 's/^/ /' + (( err++ )) + fi +done +exit $err diff --git a/version-manifest/src/main/scripts/check-docker-manifest.sh b/version-manifest/src/main/scripts/check-docker-manifest.sh index 6aa2374b1..384e28434 100755 --- a/version-manifest/src/main/scripts/check-docker-manifest.sh +++ b/version-manifest/src/main/scripts/check-docker-manifest.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ "$#" -ne 1 ]; then - echo This script checks docker-manifest.csv to verify that the specified versions exist in nexus3 + echo This script checks docker-manifest.csv to verify that the specified versions have been released in nexus3 echo "$0 <docker-manifest.csv>" exit 1 fi |