From 9c67d15489b6e05fbd1c416cec4113faa2b58734 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 12 Feb 2024 08:00:25 +0000 Subject: [PATCH] Fix standup and teardown scripts Signed-off-by: Marcus Noble --- home/.bin/gs-standup | 13 ++++++++++++- home/.bin/gs-teardown | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/home/.bin/gs-standup b/home/.bin/gs-standup index 23c6ead..39cf287 100755 --- a/home/.bin/gs-standup +++ b/home/.bin/gs-standup @@ -3,6 +3,8 @@ source .utils CODE_DIR="${HOME}/Code/GiantSwarm/cluster-test-suites" +CUR_DIR=$(pwd) +OUTPUT_DIR=${CUR_DIR} print_usage() { orange "gs-standup - Standup a new test workload cluster, using the cluster-test-suites modules." @@ -17,6 +19,7 @@ print_usage() { underline "Options:" echo "-h, --help show this help text" echo " --dir override the directory of cluster-test-suite code" + echo "-o --output override the directory the files output to" } POS_ARGS=() @@ -32,6 +35,11 @@ while test $# -gt 0; do CODE_DIR=$1 shift ;; + -o|--output) + shift + OUTPUT_DIR=$1 + shift + ;; *) POS_ARGS+=(`echo $1 | tr '/' ' '`) shift @@ -75,11 +83,14 @@ case ${#POS_ARGS[@]} in ;; esac + cd ${CODE_DIR} go run ${CODE_DIR}/cmd/standup/main.go \ --provider ${PROVIDER} \ --context ${CONTEXT} \ --cluster-values ${CODE_DIR}/providers/${CONTEXT}/standard/test_data/cluster_values.yaml \ - --default-apps-values ${CODE_DIR}/providers/${CONTEXT}/standard/test_data/default-apps_values.yaml + --default-apps-values ${CODE_DIR}/providers/${CONTEXT}/standard/test_data/default-apps_values.yaml \ + --output ${OUTPUT_DIR} + cd ${CUR_DIR} ;; *) print_usage diff --git a/home/.bin/gs-teardown b/home/.bin/gs-teardown index cb6e8eb..1e1a67c 100755 --- a/home/.bin/gs-teardown +++ b/home/.bin/gs-teardown @@ -3,6 +3,8 @@ source .utils CODE_DIR="${HOME}/Code/GiantSwarm/cluster-test-suites" +CUR_DIR=$(pwd) +INPUT_DIR=${CUR_DIR} print_usage() { orange "gs-teardown - Teardown a previously created test cluster" @@ -17,6 +19,7 @@ print_usage() { underline "Options:" echo "-h, --help show this help text" echo " --dir override the directory of cluster-test-suite code" + echo " --in override the directory where the previously output files exist" } POS_ARGS=() @@ -32,6 +35,11 @@ while test $# -gt 0; do CODE_DIR=$1 shift ;; + --input) + shift + INPUT_DIR=$1 + shift + ;; *) POS_ARGS+=(`echo $1 | tr '/' ' '`) shift @@ -75,10 +83,12 @@ case ${#POS_ARGS[@]} in ;; esac + cd ${CODE_DIR} go run ${CODE_DIR}/cmd/teardown/main.go \ --provider ${PROVIDER} \ --context ${CONTEXT} \ - --standup-directory ./ + --standup-directory ${OUTPUT_DIR} + cd ${CUR_DIR} ;; *) print_usage