aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-10-25 07:09:36 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-10-25 07:10:29 -0700
commit9ac1c298b240b54f13cb5a44ea80bda584e7fed2 (patch)
tree3c9414442c4590ebcfbb7e368098408677a7a05e /version-manifest/src/main/scripts
parent131f63d7741c5cf7b6ad2330b4f3bb91826b589c (diff)
Script to check docker staging versions vs release
Change-Id: Icc73fe30ab65f90a513e77e814a0c2ea3e5f1d61 Issue-ID: INT-586 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-xversion-manifest/src/main/scripts/compare-docker-manifests.sh25
1 files changed, 25 insertions, 0 deletions
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