Gary Wu | 9ac1c29 | 2018-10-25 07:09:36 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [ "$#" -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 |
| 7 | fi |
| 8 | |
| 9 | if [ -z "$WORKSPACE" ]; then |
| 10 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 11 | fi |
| 12 | |
| 13 | export LC_ALL=C |
| 14 | |
| 15 | err=0 |
| 16 | for 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 |
| 24 | done |
| 25 | exit $err |