2

I have build-pipeline job i Jenkins which goes like this

Job-1 --triggers -> Job-2 and Job-3. sometimes I want to trigger only Job-2 but not Job 3. I setup Boolean parameter ( from Parameterized Trigger Plugin) which has check boxes for "True" or "false". I have set up the boolean parameter in post-build action of Job-1 and regardless of the check box value, all of my downstream Jobs ( Job-2 and Job-3)always get triggered.

Is there a way to trigger skip some of downstream jobs using a parameter.

Above is an example, My actual pipeline has lot of jobs with using Java( maven), Powershell, Shell scripts, batch etc.

1 Answer 1

3

On your job3, you can use the Conditional Step plugin: https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin

In the build section, add a Conditional Step (single) using on the boolean parameter set by the job1:

  • Run: Boolean condition
  • Token: ${JOB1_BOOLEAN}

Cheers, Bruno

0

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.