I am using jenkins pipeline to pass node parameter from one job to another.
Here is code:-
parameters: [
                             $class: 'NodeParameterValue', 
                             name: 'UPSTREAM_NODE', 
                             labels: ["${nodeToBeExecuted}"], 
                             nodeEligibility: [$class: 'AllNodeEligibility']
                         [$class: 'StringParameterValue', name: 
'ansibleHostFile', value: "a9mpcl1.hosts"]

Above is working fine when I am passing it to Jenkins project, but it 
doesn;t work in case of Jenkins pipeline

Code for accepting Input as parameter:

import java.text.SimpleDateFormat
import java.util.Calendar
import java.io.File
import org.jvnet.jenkins.plugins.nodelabelparameter.*

pipeline {
    agent { node { label 'perf' } } 
    parameters {
NodeParam(name: 'UPSTREAM_NODE', description: 'select node', defaultNodes: 
['perfslave1'], allowedNodes: ['perfslave1', 'perf slave2'], trigger: 
'multiSelectionDisallowed', eligibility: 'IgnoreOfflineNodeEligibility')

Can you please suggest what should I use to accept the input as node 

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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to