I'm going to go with
def h = Jenkins.instance
// manipulate labels
synchronized(h) {
h.setNodes(h.nodes)
}
On 12/30/2015 02:07 PM, Jay Berkenbilt wrote:
> I have some groovy code that, under certain conditions, changes the
> labels on nodes, and I've been having a hard time figu
I have some groovy code that, under certain conditions, changes the
labels on nodes, and I've been having a hard time figuring out exactly
how to do it in a way that takes effect right away.
I can do something like
def slave = Hudson.instance.getSlave("slave-name")
slave.labelString = "new labels
Ultimately I ended up getting this working by using
https://wiki.jenkins-ci.org/display/JENKINS/Global+Post+Script+Plugin
with a one line change, which will be in 1.1.0, to allow the hook to run
on aborted jobs as well as others. These other plugins were very
helpful. I was mostly through writing a
on the
performance of our Jenkins master since they all run in master's context
but can run in parallel at a scale equal to the number of slaves. (Or
something approximating that.)
Does this seem like a reasonable thing to try? Am I looking in the right
place? Has someone already done this and