Commit 6a354986 authored by Andreas König's avatar Andreas König

try to enable helm deployments

parent 141d6c79
Pipeline #12888 passed with stage
in 1 minute and 23 seconds
...@@ -48,11 +48,26 @@ metadata: ...@@ -48,11 +48,26 @@ metadata:
name: $KUBE_NAMESPACE name: $KUBE_NAMESPACE
EOF EOF
export CHART_DIR="src/helm/charts/${CI_PROJECT_NAME}"
export DEPLOYMENT_YML_FILE="${DEPLOYMENT_YML_FILE:-deployment.yml}" export DEPLOYMENT_YML_FILE="${DEPLOYMENT_YML_FILE:-deployment.yml}"
if [ -e "${DEPLOYMENT_YML_FILE}" ]; then
source <(echo 'kubectl apply -n $KUBE_NAMESPACE -f - <<EOFOFDEPLOYMENTYML'; cat "${DEPLOYMENT_YML_FILE}"; echo EOFOFDEPLOYMENTYML)
else
if [ -d "$CHART_DIR" ]; then
helm upgrade --install \
--wait \
--set image.repository="$CI_REGISTRY_IMAGE" \
--set image.tag="$CI_REGISTRY_TAG" \
--set application.track="$track" \
--set ingress.hostname="$CI_ENVIRONMENT_HOSTNAME" \
--set replicaCount="$replicas" \
--namespace="$KUBE_NAMESPACE" \
--version="$CI_PIPELINE_ID-$CI_BUILD_ID" \
"$CI_ENVIRONMENT_SLUG" \
"$CHART_DIR"
elif [ -e "${DEPLOYMENT_YML_FILE}" ]; then
source <(echo 'kubectl apply -n $KUBE_NAMESPACE -f - <<EOFOFDEPLOYMENTYML'; cat "${DEPLOYMENT_YML_FILE}"; echo EOFOFDEPLOYMENTYML)
else
cat <<EOF | kubectl apply -n $KUBE_NAMESPACE -f - cat <<EOF | kubectl apply -n $KUBE_NAMESPACE -f -
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
......
...@@ -17,3 +17,5 @@ echo "Removing all pods..." ...@@ -17,3 +17,5 @@ echo "Removing all pods..."
kubectl delete all -l "app=$CI_ENVIRONMENT_SLUG" -n "$KUBE_NAMESPACE" kubectl delete all -l "app=$CI_ENVIRONMENT_SLUG" -n "$KUBE_NAMESPACE"
echo "Removing ingress..." echo "Removing ingress..."
kubectl delete ingress -l "app=$CI_ENVIRONMENT_SLUG" -n "$KUBE_NAMESPACE" kubectl delete ingress -l "app=$CI_ENVIRONMENT_SLUG" -n "$KUBE_NAMESPACE"
echo "remove helm deployments"
helm delete "$CI_ENVIRONMENT_SLUG" || true
Markdown is supported
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