1

Why my pipeline doesn't work? I just want include this .yml if "NATIVE_COMPILE" is "true".

variables:
  NATIVE_COMPILE : "true"
include:
  - project: 'pipelines/cicd'
    ref: improve/simplificando-pipes
    file: 'libraries/bundle/java/maven/.gitlab-ci-native.template.yml'
    rules:
      - if: $NATIVE_COMPILE == "true"

If i use something like:

include:
  - project: 'pipelines/cicd'
    ref: improve/simplificando-pipes
    file: 'libraries/bundle/java/maven/.gitlab-ci-native.template.yml'
    rules:
      - if $CI_COMMIT_MESSAGE =~ /.*--native-compile*/

And write "--native-compile" on commit, its works perfectly, but with my variables doesnt work.

Someone can help me, pls ?

1 Answer 1

0

Add the variable as a global project variable so that you can get its value in the linked yml file.

Settings -> CI/CD -> Variables

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.