From 430e78d3c265ac3b1570b7fb567f1205c27886d8 Mon Sep 17 00:00:00 2001 From: Sebastian Wollner Date: Fri, 30 Aug 2024 09:21:26 +0200 Subject: [PATCH] fix: shell exit code --- .../resources/archetype-resources/deploy.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/archetypes/helm/src/main/resources/archetype-resources/deploy.sh b/archetypes/helm/src/main/resources/archetype-resources/deploy.sh index a348a4fb..e4f72ae3 100755 --- a/archetypes/helm/src/main/resources/archetype-resources/deploy.sh +++ b/archetypes/helm/src/main/resources/archetype-resources/deploy.sh @@ -121,7 +121,10 @@ popd >/dev/null || exit diff() { echo "Request diff from last revision, please wait ..." echo "" + # temporarily disable the script from exiting on a non-zero status code + set +e helm diff upgrade --install "${RELEASE}" "${CHART}" "${ARGS[@]}" + set -e } tryRun(){ @@ -262,14 +265,16 @@ runAsWizard() { if [[ $WIZARD == "true" ]] ; then runAsWizard else - [[ $DIFF == "true" ]] && { + if [[ $DIFF == "true" ]] ; then diff - } - [[ $TRY_RUN == "true" ]] && { + fi + + if [[ $TRY_RUN == "true" ]] ; then tryRun - } + fi - [[ $DEPLOY == "true" ]] && { + if [[ $DEPLOY == "true" ]] ; then execute - } + fi + fi