Skip to content
Snippets Groups Projects
Commit d03994b9 authored by Lukas Schreiner's avatar Lukas Schreiner
Browse files

Added uninstall step

parent 50bfb2ae
Branches
No related tags found
No related merge requests found
Pipeline #111 failed
......@@ -3,6 +3,13 @@
paths:
- target/
.kubeauth:
script:
- kubectl config set-cluster k8s-cluster --server=$KUBE_HOST --certificate-authority=$KUBE_API_CERT
- kubectl config set-credentials k8s-deployer --token=$KUBE_API_TOKEN
- kubectl config set-context k8s-context --cluster k8s-cluster --user k8s-deployer --namespace=$KUBE_NAMESPACE
- kubectl config use-context k8s-context
stages:
- build_binary
- build_docker
......@@ -40,15 +47,24 @@ deploy:
- main
environment:
name: production
url: http://payslip-downloader.k3s.mimono.lan
script:
- kubectl config set-cluster k8s-cluster --server=$KUBE_HOST --certificate-authority=$KUBE_API_CERT
- kubectl config set-credentials k8s-deployer --token=$KUBE_API_TOKEN
- kubectl config set-context k8s-context --cluster k8s-cluster --user k8s-deployer
- kubectl config use-context k8s-context
- !reference [kubeauth]
- mkdir tmp
- 'echo -e "registry_image: \"$CI_REGISTRY_IMAGE\"" > tmp/values.yaml'
- 'echo -e "\ncommit_short_sha: \"$CI_COMMIT_SHORT_SHA\"" >> tmp/values.yaml'
- 'echo -e "\ndeploy_namespace: \"$KUBE_NAMESPACE\"" >> tmp/values.yaml'
- 'echo -e "\nsecret_store: \"$KUBE_SECRET_STORE\"" >> tmp/values.yaml'
- helm upgrade --install --values tmp/values.yaml --kube-context k8s-context $KUBE_NAME payslip-downloader
stop:
stage: deploy
image: dtzar/helm-kubectl:3.7.0
only:
- main
script:
- !reference [kubeauth]
- helm uninstall --kube-context k8s-context $KUBE_NAME
when: manual
environment:
name: production
action: stop
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment