Commit 37b79dfa authored by Rémy Coutable's avatar Rémy Coutable

Update the Review Apps cleanup function

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 930c58f7
......@@ -159,9 +159,9 @@ function delete() {
}
function cleanup() {
kubectl get ingress,configmap,all -n "$KUBE_NAMESPACE" \
-o jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{"\n"}{end}' \
| grep "CI_ENVIRONMENT_SLUG" \
| xargs -n2 kubectl delete -n "$KUBE_NAMESPACE" \
kubectl -n "$KUBE_NAMESPACE" get ingress,svc,pdb,hpa,deploy,statefulset,job,pod,secret,configmap,pvc,secret,clusterrole,clusterrolebinding,role,rolebinding,sa 2>&1 \
| grep "$CI_ENVIRONMENT_SLUG" \
| awk '{print $1}' \
| xargs kubectl -n "$KUBE_NAMESPACE" delete \
|| 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