blob: b17b46dd1ee784b5a16f354a44c712eb5eb1d95f [file] [log] [blame]
Gary Wu4885ce62018-05-07 12:27:37 -07001#!/bin/bash
2
Alexis de Talhouƫt98814dc2018-09-19 11:49:04 -04003realpath() {
4 OURPWD="$PWD"
5 cd "$(dirname "$1")"
6 LINK=$(readlink "$(basename "$1")")
7 while [ "$LINK" ]; do
8 cd "$(dirname "$LINK")"
9 LINK=$(readlink "$(basename "$1")")
10 done
11 REALPATH="$PWD/$(basename "$1")"
12 cd "$OURPWD"
13 echo "$REALPATH"
14}
15
Gary Wu4885ce62018-05-07 12:27:37 -070016if [ "$#" -ne 2 ]; then
17 echo This script updates OOM helm charts to use versions in docker-manifest.csv
Gary Wu64c540b2018-05-09 15:04:32 -070018 echo "$0 <docker-manifest.csv> <oom repo directory>"
Gary Wu4885ce62018-05-07 12:27:37 -070019 exit 1
20fi
21
22# expected parameters
23MANIFEST=$(realpath $1)
24OOM_DIR=$(realpath $2)
25
26if [ -z "$WORKSPACE" ]; then
27 export WORKSPACE=`git rev-parse --show-toplevel`
28fi
29
Gary Wu4885ce62018-05-07 12:27:37 -070030cd $OOM_DIR/kubernetes
31
32for line in $(tail -n +2 $MANIFEST); do
33 image=$(echo $line | cut -d , -f 1)
34 tag=$(echo $line | cut -s -d , -f 2)
Gary Wu44f836b2018-05-10 23:54:22 -070035 perl -p -i -e "s|$image(:.*$\|$)|$image:$tag|g" $(find ./ -name values.yaml)
Gary Wu4885ce62018-05-07 12:27:37 -070036done
37