简体   繁体   中英

Jenkins, Multijob, how to run in parallel?

We have set up a Jenkins instance as a remote testing resource for our developers. Every time a tag is created matching our refspec a job is triggered and the results emailed to the developer.

A job is defined as follows:

  1. 1 phase consisting of three jobs (frontend tests, integration tests, unit tests)
  2. All subjobs are executed, irrespective of success
  3. Email the developer the test results

This setup mostly works except for two issues:

  1. I cannot get the job to run in parallel. The subjobs run in parallel, but only one instance of the job runs at a time. Is this something I can configure differently somewhere, or is this inherent in the way the plugin works?
  2. The main job checks out and occupies one of our build servers for the duration of the job. Is there a way to do git polling and then just grab the hashref and release the build server on which the polling was done before continuing building the subjobs?
  1. In the multi job plugin , everything runs in parallel that is listed in the same "Phase", however the multijob itself needs somewhere to run. If you have a build followed by a test phase, you can add a "Build Phase" prior to the test phase, and only that phase will require a "build server".

  2. There is an option called "Execute concurrent builds if necessary" that will allow multiple jobs of the same name to run simultaneously. This option must be set for the parent job and the subjobs as the default behavior of Jenkins is to only allow one build of a Project (job) to run at a time. Beware: Read the comments as this may have unintended side effects.

Not clear what you mean about polling however if using git, you may want to use webhooks so that pushes to the git repository directly invoke Jenkins. No need to poll.

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