diff --git a/stable/dotnetcore/compile-function.sh b/stable/dotnetcore/compile-function.sh index 0029d4b..c1ff2a5 100644 --- a/stable/dotnetcore/compile-function.sh +++ b/stable/dotnetcore/compile-function.sh @@ -1,5 +1,14 @@ #!/bin/bash +exit_on_error() { + exit_code=$? + last_command=$(fc -ln -1 | awk '{$1=$1};1') + if [ $exit_code -ne 0 ]; then + echo "\"${last_command}\" command failed with exit code ${exit_code}." + exit $exit_code + fi +} + # kubeless function directory PROJECT_MOUNT=$1 echo Mount $PROJECT_MOUNT @@ -28,4 +37,6 @@ fi # compile dotnet restore $USER_PROJ --packages $PACKAGES_DIR +exit_on_error dotnet publish $USER_PROJ -o publish -c Release --no-restore +exit_on_error \ No newline at end of file diff --git a/stable/dotnetcore/dotnetcore.jsonnet b/stable/dotnetcore/dotnetcore.jsonnet index 15f32d2..5f81677 100644 --- a/stable/dotnetcore/dotnetcore.jsonnet +++ b/stable/dotnetcore/dotnetcore.jsonnet @@ -51,7 +51,7 @@ version: "3.1", images: [{ phase: "compilation", - image: "lorenzoangelini3/kubeless-compile-dotnetcore31@sha256:12a85136102b9df6b09138dadd3bf77af111dc992286a0fd8ab4b03fd897fcc5", + image: "lorenzoangelini3/kubeless-compile-dotnetcore31@sha256:c930e3c575af881d2ca537322ee7149e91c868b18b4036dae3f3624c3683ebc2", command: "/app/compile-function.sh $KUBELESS_INSTALL_VOLUME" }, { phase: "runtime",