Jenkins - resource management

流过昼夜 提交于 2019-12-12 17:30:52

问题


is it possible to manage some resources in Jenkins? By that I mean only certain number of jobs should run in parallel. E.g. my license server can provide only 4 licenses, so each job that uses such license should first check if some counter is greater that zero, next decrement and increment back after license is not needed anymore. There is Exclusion Plugin, but I think it can only create mutex (counter equals 1) not semaphore (counter equals 1 or more). Simple variable in script is not a solution, because same counter must be visible by master and all slaves. Any ideas how to handle that? Thanks in advance.


回答1:


You can use the Throttle Concurrent Builds Plugins. You can do it in two ways:

  • If the restriction applies to only one job, you can edit the job itself. There is a Throttle Concurrent Builds setting, where you can configure how many concurrent builds of the same job are allowed.
  • If there are multiple jobs that have to be restricted, then you can define Multi-Project Throttle Categories in the global configuration. You define a category with a restriction, and then tag every job that has to be restricted with this category.


来源:https://stackoverflow.com/questions/10845889/jenkins-resource-management

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!