pipeline with node label parameter is not running in parallel

76 views
Skip to first unread message

padmasr...@googlemail.com

unread,
Jun 29, 2017, 7:48:55 AM6/29/17
to Jenkins Users
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]]
      
    }
}
Reply all
Reply to author
Forward
0 new messages