From 5b5a8147987d449b2728c984d41fa01e588342f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20B=C3=B6ttcher?= <c.boettcher@fz-juelich.de>
Date: Tue, 14 Feb 2023 09:59:51 +0100
Subject: [PATCH] cleanup rules for cleanup

---
 .gitlab-ci.yml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0e48300..0f33731 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -102,6 +102,7 @@ full-deploy-production:
   stage: deploy
   environment: Production
   rules:
+     - if: ($CI_COMMIT_TAG =~ /stable/ && $MANUAL_FULL_DEPLOY_PRODUCTION == "true")
   <<: *ssh_setup
   script:
     - echo "Starting the full production deployment of airflows."
@@ -160,8 +161,7 @@ cleanup-successful-full-deployment:
   stage: cleanup
   when: on_success
   rules:
-     - if: $MANUAL_FULL_DEPLOY_PRODUCTION == "true"
-       when: tags
+     - if: ($CI_COMMIT_TAG =~ /stable/ && $MANUAL_FULL_DEPLOY_PRODUCTION == "true")
   script:
     - echo "This is the cleanup for the full-redeployment of the testing or production servers"
     - echo "if this job is reached, all earlier jobs were successful, and any lingering old instances need to be removed"
@@ -175,8 +175,7 @@ cleanup-failed-full-deployment:
   stage: cleanup
   when: on_failure
   rules:
-     - if: $MANUAL_FULL_DEPLOY_PRODUCTION == "true"
-       when: tags
+     - if: ($CI_COMMIT_TAG =~ /stable/ && $MANUAL_FULL_DEPLOY_PRODUCTION == "true")
   <<: *ssh_setup
   script:
     - echo "This is the cleanup for the full-redeployment of the testing or production servers"
-- 
GitLab