From 3050cc2a477388a714a5f9024b012958f194de4f Mon Sep 17 00:00:00 2001
From: Julien Leduc <julien.leduc@cern.ch>
Date: Fri, 17 Jun 2022 17:59:13 +0200
Subject: [PATCH] Resolve "Run cta_valgrind CI job in the nightly pipeline"
 Will now run on schedules in master branch and can run manually in any branch
 otherwise.

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5abf11eaea..6c54bf307a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -136,10 +136,14 @@ release_public_rpm:
     - docker
 
 cta_valgrind:
-  except:
-    - tags
   stage: test
-  retry: 1
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "push"
+      when: manual
+      allow_failure: true
+    - if: $CI_PIPELINE_SOURCE == "schedule"
+      when: on_success
+      allow_failure: false
   variables:
     CTAREPODIR: /tmp/repo
   image: gitlab-registry.cern.ch/linuxsupport/cc7-base
@@ -151,7 +155,6 @@ cta_valgrind:
     - createrepo ${CTAREPODIR}; echo -e "[cta-artifacts]\nname=CTA artifacts\nbaseurl=file://${CTAREPODIR}\ngpgcheck=0\nenabled=1\npriority=2" > /etc/yum.repos.d/cta-artifacts.repo
     - yum -y --nogpgcheck install cta-systemtests cta-debuginfo sqlite-debuginfo --enablerepo=debug
     - /usr/bin/cta-unitPlusSystemTests.sh
-
   tags:
     - docker
 
@@ -308,9 +311,10 @@ nightly1:
 
 regressioneos:
   stage: regressions
-  only:
-    - triggers
-    - schedules
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule"
+      when: on_success
+      allow_failure: true
   script:
     - echo "Running nightly eos regression tests"
     - export NAMESPACE="archiveretrieve-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)"
-- 
GitLab