0

I am using gitlabci.yaml to import some existing deployment templates-- a.yml and b.yml.

I am trying to control this using a flag RELEASE_PIPELINE, which if true should pickup template b.yml and if false should pickup a.yml.

Below is how to the gitlab yaml looks like:

RELEASE_PIPELINE:
       value: "false"
       options:
         - "false"
         - "true"

include:
  - project: abc/def
   ref: main
   file: templates/a.yml
   rules:
     - $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH && $CI_OPEN_MERGE_REQUESTS == null && $RELEASE_PIPELINE == "false"

 - project: abc/def
   ref: main
   file: templates/release/b.yml
   rules:
      - if: $RELEASE_PIPELINE == "true"

Given the fact that I would like to have the default value as false, my automated triggers do not seem to recognise the below block.

include:
  - project: abc/def
   ref: main
   file: templates/a.yml
   rules:
     - $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH && $CI_OPEN_MERGE_REQUESTS == null && $RELEASE_PIPELINE == "false"

When I manually select false from the drop down, it does seem to pick up a.yml. What am i doing wrong?

B.T Anand
  • 549
  • 1
  • 13
  • 26
  • Can you point to the documentation that explains what "options:" does? The documentation: https://docs.gitlab.com/ee/ci/variables/#define-a-cicd-variable-in-the-gitlab-ciyml-file suggests you need to set to "false" instead of trying to define a "value" separately. – Arty-chan Mar 21 '23 at 17:43

0 Answers0