0

I have a pipeline that builds one or multiple downstream jobs, but I just want that only build once the downstream job.

The main reason is that some jobs are triggered based on multiple conditions, and if one of the conditions match, I'll trigger that job a few times. Could we set a limit per downstream job? or at least set a flag that I can check before trigger another duplicate job?

The current job build that I use is the following: build(job: job, parameters: jobparams, wait: false)

Is there any variable that I can access to know the downstream jobs trigger by the current job?

Eloy Coto
  • 73
  • 1
  • 8
  • what does `I'll trigger that job the number of matches` mean ?? if you wish to run a job only once and a flag in all your cases and if any of them matches then set it to true and in the end you can check the flag value and build the project accordingly – rohit thomas Aug 07 '18 at 03:57
  • Edited now. sorry! The idea is to have a flag in Jenkins to know if that job is already triggered to skip to build two times. Any idea? @rohitthomas – Eloy Coto Aug 07 '18 at 14:20
  • Why do you wish to run the same job again are the parameters different ?? You can use the API feature, explained here https://stackoverflow.com/questions/7285891/determine-if-given-job-is-currently-running-using-hudson-jenkins-api.... – rohit thomas Aug 08 '18 at 02:27

0 Answers0