Commit 873c37e9 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ml-review-app-delete-release-before-each-deploy' into 'master'

Always delete release before review app deployment

See merge request gitlab-org/gitlab!65405
parents 43be7e3a 8340b0e5
...@@ -94,13 +94,13 @@ review-deploy: ...@@ -94,13 +94,13 @@ review-deploy:
before_script: before_script:
- *base-before_script - *base-before_script
review-stop-failed-deployment: review-delete-deployment:
extends: extends:
- .review-stop-base - .review-stop-base
- .review:rules:review-stop-failed-deployment - .review:rules:review-delete-deployment
stage: prepare stage: prepare
script: script:
- delete_failed_release - delete_release
review-stop: review-stop:
extends: extends:
...@@ -108,7 +108,7 @@ review-stop: ...@@ -108,7 +108,7 @@ review-stop:
- .review:rules:review-stop - .review:rules:review-stop
stage: post-qa stage: post-qa
script: script:
- delete_release - delete_k8s_release_namespace
.review-qa-base: .review-qa-base:
extends: extends:
......
...@@ -1180,7 +1180,7 @@ ...@@ -1180,7 +1180,7 @@
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
allow_failure: true allow_failure: true
.review:rules:review-stop-failed-deployment: .review:rules:review-delete-deployment:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
......
...@@ -92,7 +92,7 @@ graph RL; ...@@ -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" 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)"]; 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" 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-8["dependency_scanning"];
1-9["qa:internal, qa:internal-as-if-foss"]; 1-9["qa:internal, qa:internal-as-if-foss"];
1-11["qa:selectors, qa:selectors-as-if-foss"]; 1-11["qa:selectors, qa:selectors-as-if-foss"];
......
...@@ -48,7 +48,9 @@ function delete_release() { ...@@ -48,7 +48,9 @@ function delete_release() {
return return
fi fi
delete_k8s_release_namespace if deploy_exists "${namespace}" "${release}"; then
helm uninstall --namespace="${namespace}" "${release}"
fi
} }
function delete_failed_release() { function delete_failed_release() {
...@@ -66,7 +68,7 @@ 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` # Cleanup and previous installs, as FAILED and PENDING_UPGRADE will cause errors with `upgrade`
if previous_deploy_failed "${namespace}" "${release}" ; then if previous_deploy_failed "${namespace}" "${release}" ; then
echoinfo "Review App deployment in bad state, cleaning up namespace ${release}" echoinfo "Review App deployment in bad state, cleaning up namespace ${release}"
delete_release delete_k8s_release_namespace
else else
echoinfo "Review App deployment in good state" echoinfo "Review App deployment in good state"
fi 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