From 74cf70f8a420f6baad75829cccc869b4b86f2147 Mon Sep 17 00:00:00 2001
From: Jorge Camarero Vera <jorge.camarero@cern.ch>
Date: Wed, 5 Oct 2022 14:59:28 +0200
Subject: [PATCH] Fix rules for tagged commits and remove xrootd5 duplications

---
 .gitlab/ci/build.gitlab-ci.yml | 26 ++++----------------------
 ReleaseNotes.md                |  1 +
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml
index 86eb6d9804..c309b6db0b 100644
--- a/.gitlab/ci/build.gitlab-ci.yml
+++ b/.gitlab/ci/build.gitlab-ci.yml
@@ -58,9 +58,9 @@ cta_rpm_xrootd4:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
     - if: $CI_COMMIT_TAG
       when: never
+    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
 
 cta_srpm_xrootd4_pgsched:
   stage: build:srpm
@@ -76,9 +76,9 @@ cta_rpm_xrootd4_pgsched:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "4" && $SCHED_TYPE == "pgsched" && $ORACLE_SUPPORT == "OFF"
     - if: $CI_COMMIT_TAG
       when: never
+    - if: $XROOTD_VERSION == "4" && $SCHED_TYPE == "pgsched" && $ORACLE_SUPPORT == "OFF"
 
 cta_srpm_xrootd5:
   stage: build:srpm
@@ -94,28 +94,10 @@ cta_rpm_xrootd5:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "5" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
     - if: $CI_COMMIT_TAG
       when: never
-
-cta_srpm_xrootd5:
-  stage: build:srpm
-  extends:
-    - .cta_srpm
-  rules:
-    - !reference [.cta_build, rules]
     - if: $XROOTD_VERSION == "5" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
 
-cta_rpm_xrootd5:
-  stage: build:rpm
-  extends:
-    - .cta_rpm
-  rules:
-    - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "5" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
-    - if: $CI_COMMIT_TAG
-      when: never
-
 cta_srpm_no_oracle:
   stage: build:srpm
   extends:
@@ -130,6 +112,6 @@ cta_rpm_no_oracle:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "OFF"
     - if: $CI_COMMIT_TAG
-      when: never
\ No newline at end of file
+      when: never
+    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "OFF"
diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index 15996eaf9d..fc57ca07ba 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -11,6 +11,7 @@
 - cta/CTA#160 - Improve DB access to get all the Tape Drive States
 - cta/CTA#164 - Cppcheck job is not failing when there are errors
 - cta/CTA#165 - Fix oracle dbunittests
+- cta/CTA#169 - Fix misconfigured rules in .gitlab-ci.yml files
 
 # v4.7.11-1
 
-- 
GitLab