blob: 86f8221e9c29077ce70a7d8537c4c742bdf04ae3 [file] [log] [blame]
Gary Wu9ac1c292018-10-25 07:09:36 -07001#!/bin/bash
2
3if [ "$#" -ne 2 ]; then
4 echo This script compares docker-manifest.csv with docker-manifest-staging.csv to verify that staging has later versions than release.
5 echo "$0 <docker-manifest.csv> <docker-manifest-staging.csv>"
6 exit 1
7fi
8
9if [ -z "$WORKSPACE" ]; then
10 export WORKSPACE=`git rev-parse --show-toplevel`
11fi
12
13export LC_ALL=C
14
15err=0
16for line in $(join -t, $1 $2 | tail -n +2); do
17 image=$(echo $line | cut -d , -f 1)
18 release=$(echo $line | cut -d , -f 2)
19 staging=$(echo $line | cut -d , -f 3)
20
21 if [[ "${staging}_" < "${release}_" ]]; then
22 echo "[WARNING] $image:$staging is older than $release."
23 fi
24done
25exit $err