Commit 8340b0e5 authored by Mark Lapierre's avatar Mark Lapierre Committed by Rémy Coutable

Always delete release before review app deployment

parent fcd2128c
......@@ -94,13 +94,13 @@ review-deploy:
before_script:
- *base-before_script
review-stop-failed-deployment:
review-delete-deployment:
extends:
- .review-stop-base
- .review:rules:review-stop-failed-deployment
- .review:rules:review-delete-deployment
stage: prepare
script:
- delete_failed_release
- delete_release
review-stop:
extends:
......@@ -108,7 +108,7 @@ review-stop:
- .review:rules:review-stop
stage: post-qa
script:
- delete_release
- delete_k8s_release_namespace
.review-qa-base:
extends:
......
......@@ -1180,7 +1180,7 @@
- <<: *if-dot-com-gitlab-org-schedule
allow_failure: true
.review:rules:review-stop-failed-deployment:
.review:rules:review-delete-deployment:
rules:
- <<: *if-not-ee
when: never
......
......@@ -92,7 +92,7 @@ graph RL;
click 1-5 "https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations?widget=6914312&udv=0"
1-6["setup-test-env (4 minutes)"];
click 1-6 "https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations?widget=6914315&udv=0"
1-7["review-stop-failed-deployment"];
1-7["review-delete-deployment"];
1-8["dependency_scanning"];
1-9["qa:internal, qa:internal-as-if-foss"];
1-11["qa:selectors, qa:selectors-as-if-foss"];
......
......@@ -48,7 +48,9 @@ function delete_release() {
return
fi
delete_k8s_release_namespace
if deploy_exists "${namespace}" "${release}"; then
helm uninstall --namespace="${namespace}" "${release}"
fi
}
function delete_failed_release() {
......@@ -66,7 +68,7 @@ function delete_failed_release() {
# Cleanup and previous installs, as FAILED and PENDING_UPGRADE will cause errors with `upgrade`
if previous_deploy_failed "${namespace}" "${release}" ; then
echoinfo "Review App deployment in bad state, cleaning up namespace ${release}"
delete_release
delete_k8s_release_namespace
else
echoinfo "Review App deployment in good state"
fi
......
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