I have had good success doing this but I pass the NODE_NAME as a specific parameter:
Build (“AnyBuild”,
BUILD_NODE:”BUILDHERE”)
Where BUILD_NODE is a NODE parameter
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/38fbb947-a6d2-494f-b2dd-7cad9e76a7db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Well, I don’t know how it chooses but I would not be surprised if there were no jobs running, that it would choose the same one first each time.
BTW, if your first build chooses one slave from a labeled group, you want to pass on to the next job the specific slave chosen. For example, you don’t care which Windows build machine the first job ends up on, but you want the other to follow suit.
def nodename=build.getBuiltOnStr()
out.println "This node is " + nodename
b = build ("second-job-core-builder",
BUILD_NODE:nodename)
Because what you want is the 2nd job to run an the specific slave that the first job selected. If you follow me?
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/290c1f31-c24b-4e5d-99a1-ebd81bb2f7f2%40googlegroups.com.
Found this as an explanation why you are getting builds on the same node:
Scheduling strategy
Some slaves are faster, while others are slow. Some slaves are closer (network wise) to a master, others are far away. So doing a good build distribution is a challenge. Currently, Jenkins employs the following strategy:
If you have interesting ideas (or better yet, implementations), please let me know.
From: Ginga, Dick
Sent: Tuesday, March 03, 2015 3:33 PM
To: jenkins...@googlegroups.com
Subject: RE: Build Flow Plugin with Node Label Parameter Plugin
Well, I don’t know how it chooses but I would not be surprised if there were no jobs running, that it would choose the same one first each time.
BTW, if your first build chooses one slave from a labeled group, you want to pass on to the next job the specific slave chosen. For example, you don’t care which Windows build machine the first job ends up on, but you want the other to follow suit.
def nodename=build.getBuiltOnStr()
out.println "This node is " + nodename
b = build ("second-job-core-builder",
BUILD_NODE:nodename)
Because what you want is the 2nd job to run an the specific slave that the first job selected. If you follow me?
From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of Katie Outram
Sent: Tuesday, March 03, 2015 2:32 PM
To: jenkins...@googlegroups.com
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/290c1f31-c24b-4e5d-99a1-ebd81bb2f7f2%40googlegroups.com.