我不能编写脚本并更改已存在的节点(非主节点)上的执行程序数.最好通过使用groovy,但如果有插件或CLI命令可以做的也很有趣.
我想要做的片段:
jenkins.model.Jenkins.instance.nodes.each { node ->
println node.getNumExecutors()
//How do I set the number of executors for a node?
}
最佳答案 目前这不可能 – Jenkins节点的numExecutors属性是只读的.
从JENKINS-23534开始:
[
setNumExecutors
] is intentionallyprivate
since Jenkins does not offer a way to change the number of executors of aSlaveComputer
orSlave
once created. Instead, you change the configuration, meaning replacing the existingSlave
.