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 | |
Gary Wu | d285191 | 2019-05-09 08:50:23 -0700 | [diff] [blame] | 21 | if [[ "${staging//./-}_" < "${release//./-}_" ]]; then |
| 22 | echo "[ERROR] $image:$staging is out-of-date vs. release ($release)." |
Gary Wu | 781a124 | 2019-05-15 21:39:54 -0700 | [diff] [blame] | 23 | |
| 24 | # Uncomment the following to update the staging manifest with the release version |
| 25 | # sed -i "s|$image,.*|$image,$release|g" $2 |
Gary Wu | 9ac1c29 | 2018-10-25 07:09:36 -0700 | [diff] [blame] | 26 | fi |
| 27 | done |
| 28 | exit $err |