Groovy script below, is used to start parallel build based on labels..so I have used nodeLabelParameter to pass label.
when I start build , build job: 'NodeLabel' is not running in parallel...though there are many free executors for that label.. one build is running at a time and others are waiting in queue and running one by one..kindly help me to resolve this issue...
//It will get nameLocation from other function..
def stepsForParallel = [:]
for (int i=0;i<nameLocation.size();i++ ) {
String[] keyvalue;
keyvalue = nameLocation[i].split(':')
def name = keyvalue[1]
def location = keyvalue[0]
stepsForParallel[i] = transformIntoStep(name,location)
}
parallel stepsForParallel
def transformIntoStep(name,location) {
return {
build job: 'NodeLabel',
parameters: [[$class: 'NodeParameterValue', name: 'labelName', labels: ["$location"], nodeEligibility: [$class: 'AllNodeEligibility']],[$class: 'StringParameterValue', name: 'buildname', value: name]]
}
}