From c9d1b98cc424d7f3d8a0fc7910458a4293c6b65d Mon Sep 17 00:00:00 2001 From: Sebastian Wollner Date: Thu, 29 Aug 2024 13:58:46 +0200 Subject: [PATCH 1/2] fix: missing template folder in webapp --- .../helm/src/main/resources/archetype-resources/deploy.sh | 3 +++ .../repository/webapp/src/main/templates/.gitkeep | 0 2 files changed, 3 insertions(+) create mode 100644 archetypes/project/src/main/resources/archetype-resources/repository/webapp/src/main/templates/.gitkeep diff --git a/archetypes/helm/src/main/resources/archetype-resources/deploy.sh b/archetypes/helm/src/main/resources/archetype-resources/deploy.sh index a348a4fb..5f8a8a80 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(){ diff --git a/archetypes/project/src/main/resources/archetype-resources/repository/webapp/src/main/templates/.gitkeep b/archetypes/project/src/main/resources/archetype-resources/repository/webapp/src/main/templates/.gitkeep new file mode 100644 index 00000000..e69de29b From 430e78d3c265ac3b1570b7fb567f1205c27886d8 Mon Sep 17 00:00:00 2001 From: Sebastian Wollner Date: Fri, 30 Aug 2024 09:21:26 +0200 Subject: [PATCH 2/2] 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