简体   繁体   中英

Does Jenkins pipeline support watching other builds and triggering on these (observer pattern)?

A Jenkins pipeline is able to trigger a build of another job as a step.

steps {
   build job: "my-downstream-job"
}

This is a push/imperative model, ie the downstream job is told to build by the upstream job.

Does Jenkins support a pull model? ie I would like a job to observe one/many other jobs and start to build itself if these other jobs are triggered.

The use case is to create a job that creates a template, and if that template changes by the template job triggering, all the other jobs that use this template will fire, rather than having to hardcode in all the dependencies into the template job.

you can try Build after other projects are built in downstream job.

For example, after Job_A is built you need Job_B to start automatically. then setup the value in Job_B, and it will work. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM