Gary Wu | 4885ce6 | 2018-05-07 12:27:37 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [ "$#" -ne 2 ]; then |
| 4 | echo This script updates OOM helm charts to use versions in docker-manifest.csv |
Gary Wu | 64c540b | 2018-05-09 15:04:32 -0700 | [diff] [blame] | 5 | echo "$0 <docker-manifest.csv> <oom repo directory>" |
Gary Wu | 4885ce6 | 2018-05-07 12:27:37 -0700 | [diff] [blame] | 6 | exit 1 |
| 7 | fi |
| 8 | |
| 9 | # expected parameters |
| 10 | MANIFEST=$(realpath $1) |
| 11 | OOM_DIR=$(realpath $2) |
| 12 | |
| 13 | if [ -z "$WORKSPACE" ]; then |
| 14 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 15 | fi |
| 16 | |
Gary Wu | 4885ce6 | 2018-05-07 12:27:37 -0700 | [diff] [blame] | 17 | cd $OOM_DIR/kubernetes |
| 18 | |
| 19 | for line in $(tail -n +2 $MANIFEST); do |
| 20 | image=$(echo $line | cut -d , -f 1) |
| 21 | tag=$(echo $line | cut -s -d , -f 2) |
Gary Wu | 44f836b | 2018-05-10 23:54:22 -0700 | [diff] [blame] | 22 | perl -p -i -e "s|$image(:.*$\|$)|$image:$tag|g" $(find ./ -name values.yaml) |
Gary Wu | 4885ce6 | 2018-05-07 12:27:37 -0700 | [diff] [blame] | 23 | done |
| 24 | |