Fix misconfigured rules in .gitlab-ci.yml files
According to gitlab documentation, rules are "evaluated in in order until the first match. When a match is found, the job is either included or excluded from the pipeline, depending on the configuration."
This means that if the first rule matches, all the following rules will be ignored.
In our CI configuration we don't take this into account.
For example, in this excerpt of build.gitlab-ci.yml
, we don't want the cta_rpm_xrootd4
stage to be executed if this is tagged CI. However, the intended behaviour ends up being ignored because the first if:
was true.
cta_rpm_xrootd4:
stage: build:rpm
extends:
- .cta_rpm
rules:
- !reference [.cta_build, rules]
- if: $XROOTD_VERSION == "4" && $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
- if: $CI_COMMIT_TAG
when: never
We should fix all situations where this happens.
Edited by Joao Afonso