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
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/37789bce-be51-467f-bbff-09a59d4bb7ce%40googlegroups.com.