1

I have a Jenkins multi configuration project with two axis:

REGION with values:

us
uk
ca
au
fr


JOBS with values:

job1
job2
job3
job4

I have to create combination filter to run:

  1. fr region only with job2
  2. job4 only with us and ca regions

How to build the expression?

Tried: ((REGION=="fr").implies(JOBS=="job2")) || !((REGION=="uk")&&(JOBS=="job4")) || !((REGION=="au")&&(JOBS=="job4"))

1 Answer 1

0

There are some mistakes in your expression. The result of the expression must be true for the tests you want to run

  • fr region only with job2

=> ((REGION=="fr") && (JOBS=="job2"))

  • job4 only with us and ca regions

=>(((REGION=="au") || (REGION=="uk")) && (JOBS=="job4"))

You also need to detail the last conditions:

  • job2 for all REGION? the first rule is then included

=> (JOBS=="jobs2")

  • job3 for all REGION except fr? Same for job1?

=>(((JOBS=="job3") || (JOBS=="job1")) && (REGION!="fr"))

Please try:

(((REGION=="au") || (REGION=="uk")) && (JOBS=="job4")) || (JOBS=="job2) || (((JOBS=="job3") || (JOBS=="job1")) && (REGION!="fr"))

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.