aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts/update-oom-image-versions.sh
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-05-07 12:27:37 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-05-07 12:45:40 -0700
commit4885ce67b35caefbcdb35091f177afdbff723972 (patch)
treee1ec1c18f5e9aa25b324266c7aea98acce145928 /version-manifest/src/main/scripts/update-oom-image-versions.sh
parent455f8d2a70886b3c858d3461e87e4be63ff1a53a (diff)
Script to sync OOM helm charts with manifest
Change-Id: Idb40b4fc8d02b82ba43f9dc4c53f485ba9939091 Issue-ID: INT-492 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts/update-oom-image-versions.sh')
-rwxr-xr-xversion-manifest/src/main/scripts/update-oom-image-versions.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/version-manifest/src/main/scripts/update-oom-image-versions.sh b/version-manifest/src/main/scripts/update-oom-image-versions.sh
new file mode 100755
index 000000000..eba847841
--- /dev/null
+++ b/version-manifest/src/main/scripts/update-oom-image-versions.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+if [ "$#" -ne 2 ]; then
+ echo This script updates OOM helm charts to use versions in docker-manifest.csv
+ echo "$0 <docker-manifest.csv> <oom directory>"
+ exit 1
+fi
+
+# expected parameters
+MANIFEST=$(realpath $1)
+OOM_DIR=$(realpath $2)
+
+if [ -z "$WORKSPACE" ]; then
+ export WORKSPACE=`git rev-parse --show-toplevel`
+fi
+
+DIR=$(dirname $(readlink -f "$0"))
+TARGET_DIR=$DIR/target
+rm -rf $TARGET_DIR
+mkdir -p $TARGET_DIR
+cd $TARGET_DIR
+
+cd $OOM_DIR/kubernetes
+
+for line in $(tail -n +2 $MANIFEST); do
+ image=$(echo $line | cut -d , -f 1)
+ tag=$(echo $line | cut -s -d , -f 2)
+ perl -p -i -e "s|image: $image(:.*$\|$)|image: $image:$tag|g" $(find ./ -name values.yaml)
+done
+