From 1765c0b5bf03a021a674c39ec5ea5f3d5dff147b Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Fri, 2 Feb 2024 20:24:15 +0100 Subject: [PATCH] chore(cli): support override file while installing Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay-cli | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/helmcharts/openreplay-cli b/scripts/helmcharts/openreplay-cli index b03c2511e..971fc530c 100755 --- a/scripts/helmcharts/openreplay-cli +++ b/scripts/helmcharts/openreplay-cli @@ -11,6 +11,8 @@ OR_REPO="${OR_REPO:-'https://github.com/openreplay/openreplay'}" #OR_VERSION="dev" # Only upgrade Openreplay # UPGRADE_OR_ONLY=1 openreplay -u +# Pass override file to the installation +# OVERRIDE_FILE=override.yaml [[ -d $OR_DIR ]] || { sudo mkdir $OR_DIR @@ -244,6 +246,16 @@ function install() { log title "Installing OpenReplay" clone_repo err_cd "$tmp_dir/openreplay/scripts/helmcharts" + # process override file while installing + # OVERRIDE_FILE=/tmp/override.yaml openreplay -i + [[ -z $OVERRIDE_FILE ]] || { + override_tmpdir=$(pwd) + err_cd /tmp + cp "$OVERRIDE_FILE" new_vars.yaml + cp "$override_tmpdir/vars.yaml" old_vars.yaml + yq '(load("old_vars.yaml") | .. | select(tag != "!!map" and tag != "!!seq")) as $i ireduce(.; setpath($i | path; $i))' new_vars.yaml >vars.yaml + mv vars.yaml "$override_tmpdir" + } SKIP_K8S_TOOLS=1 DOMAIN_NAME=$domain_name bash init.sh return }