Commit cc3f8a45 authored by Michael Leu's avatar Michael Leu 🌿
Browse files

fix: exit shell scripts immediately if error occurs

So scripts behave the same as `script:` sections in the pipeline.

Fixes helm errors not failing the deploy job.
```
Error: UPGRADE FAILED:
Deployment successful 😻
```
parent 8bff4c2a
Pipeline #134130 passed with stages
in 3 minutes and 28 seconds
#!/bin/bash
set -e
kubectl create secret -n "$NAMESPACE" \
docker-registry $IMAGE_PULL_SECRET \
--docker-server="$CI_REGISTRY" \
......
#!/bin/bash
set -e
RELEASE_NAME=${CUSTOMER_NAME}-${APP_NAME}-${CI_ENVIRONMENT_SLUG}
echo "Delete $RELEASE_NAME"
helm3 uninstall "$RELEASE_NAME" --namespace "$NAMESPACE"
#!/bin/bash
set -e
echo "Deploy to kubernetes"
RELEASE_NAME=${CUSTOMER_NAME}-${APP_NAME}-${CI_ENVIRONMENT_SLUG}
......
#!/bin/bash
set -e
echo "Ensure Namespace $NAMESPACE"
kubectl describe namespace "$NAMESPACE" || kubectl create namespace "$NAMESPACE"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment