diff options
author | Yang Xu <yang.xu3@huawei.com> | 2018-10-25 20:39:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-10-25 20:39:27 +0000 |
commit | d283183d8f6a6d2bbb5df5afc9ac5e0185bc785d (patch) | |
tree | 332e5c6f50f75f4f2cb6d1d84c9472590073366e /version-manifest | |
parent | 8e797aa3e92dbb48ba89654f6d84a5d6c3b0133c (diff) | |
parent | 9ac1c298b240b54f13cb5a44ea80bda584e7fed2 (diff) |
Merge "Script to check docker staging versions vs release"
Diffstat (limited to 'version-manifest')
-rw-r--r-- | version-manifest/pom.xml | 14 | ||||
-rwxr-xr-x | version-manifest/src/main/scripts/compare-docker-manifests.sh | 25 |
2 files changed, 39 insertions, 0 deletions
diff --git a/version-manifest/pom.xml b/version-manifest/pom.xml index 27fb4f478..48dd9c12a 100644 --- a/version-manifest/pom.xml +++ b/version-manifest/pom.xml @@ -150,6 +150,20 @@ </configuration> </execution> <execution> + <id>compare-docker-manifests</id> + <phase>validate</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <arguments> + <argument>${project.basedir}/src/main/scripts/compare-docker-manifests.sh</argument> + <argument>${project.basedir}/src/main/resources/docker-manifest.csv</argument> + <argument>${project.basedir}/src/main/resources/docker-manifest-staging.csv</argument> + </arguments> + </configuration> + </execution> + <execution> <id>check-java-artifacts-released</id> <phase>verify</phase> <goals> diff --git a/version-manifest/src/main/scripts/compare-docker-manifests.sh b/version-manifest/src/main/scripts/compare-docker-manifests.sh new file mode 100755 index 000000000..86f8221e9 --- /dev/null +++ b/version-manifest/src/main/scripts/compare-docker-manifests.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo This script compares docker-manifest.csv with docker-manifest-staging.csv to verify that staging has later versions than release. + echo "$0 <docker-manifest.csv> <docker-manifest-staging.csv>" + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +export LC_ALL=C + +err=0 +for line in $(join -t, $1 $2 | tail -n +2); do + image=$(echo $line | cut -d , -f 1) + release=$(echo $line | cut -d , -f 2) + staging=$(echo $line | cut -d , -f 3) + + if [[ "${staging}_" < "${release}_" ]]; then + echo "[WARNING] $image:$staging is older than $release." + fi +done +exit $err |