简体   繁体   中英

How to create groups of jobs in Jenkins?

I have some projects that can be divided into two groups. First group are big building jobs, that can last many hours, the second one are application modules that are being built fairly quickly.
What I want to do, is to tell Jenkins to build only one task from group one, and at the same time it should be possible to build concurrently tasks from the secon, fast-building group. This would allow concurrent group building without need to wait for long running task to finish.
Is there a plugin for such things? I've tried Throttle Concurrent Builds, but it executes concurrently many tasks from long running group, occupying all executors.

You can use the Build Blocker Plugin for group A. So, every job in group A will block if any of its group-sibilings is running. That should use one executor at a time for group A jobs and leave the other executors free for group B

Check out the Jenkins Multijob plugin

https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin

If you don't have any order in which the jobs need to run, you can lump all the jobs into one "multijob Phase". Jobs in the same phase are run concurrently in different threads.

If you need the jobs to be run in a certain order, you'll probably need a multijob of two multi jobs.

You can also create a workflow in the future if you need it.

You can now use the lockable resources plugin to achieve this: https://wiki.jenkins-ci.org/display/JENKINS/Lockable+Resources+Plugin

Simply create a resource, eg 'BigJobBuilder', that each of the big jobs lock at the start of their build and releases when it is done. Only 1 of the big jobs can run that way, the others will be waiting for the current big job to be finished.

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