From 88cf36b6746a057ae2a99ce06c34fc9382859040 Mon Sep 17 00:00:00 2001 From: Honnix Date: Mon, 11 Nov 2019 22:07:11 +0100 Subject: [PATCH] pass argument to kustomize script (#14) By accepting an argument, users of this script would be able to specify which deployment to build. Internally we have customized overlay which doesn't make sense to open source, but still we would like to utilize as much as possible from this repo. --- script/kustomize.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/script/kustomize.sh b/script/kustomize.sh index 1b89c6199b..a5aa74933b 100755 --- a/script/kustomize.sh +++ b/script/kustomize.sh @@ -1,10 +1,14 @@ +#!/usr/bin/env bash + set -ex +DEPLOYMENT=${1:-sandbox test} + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" KUSTOMIZE_IMAGE="lyft/kustomizer:v3.1.0" -# flyte test -docker run -v "${DIR}/../kustomize":/kustomize "$KUSTOMIZE_IMAGE" kustomize build overlays/test/flyte > "${DIR}/../deployment/test/flyte_generated.yaml" - -# flyte local -docker run -v "${DIR}/../kustomize":/kustomize "$KUSTOMIZE_IMAGE" kustomize build overlays/sandbox/flyte > "${DIR}/../deployment/sandbox/flyte_generated.yaml" +for deployment in ${DEPLOYMENT}; do + docker run -v "${DIR}/../kustomize":/kustomize "$KUSTOMIZE_IMAGE" kustomize build \ + "overlays/${deployment}/flyte" \ + > "${DIR}/../deployment/${deployment}/flyte_generated.yaml" +done