NodeLabel Parameter Plugin with Scripted pipeline

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NodeLabel Parameter Plugin with Scripted pipeline

jerome-2
Is anybody can point me to some info or an how to use the node and label parameter.

I can make it work with a choice list but I would rather make it work with the plugin if possible with proper default value.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1be9feec-0729-4741-8871-514aa8db982f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NodeLabel Parameter Plugin with Scripted pipeline

jerome-2
For prosperity, my finding is:
  1. it seem like the node have their node name as label automatically (I realized this when trying to add the node name to the label, the label was disappearing when saving the changes) 
  2. Knowning number 1 point, I could just use the named parametrized input and ask for the node name as unique label, which was forcing the Jenkinsfile to run on that node.
  3. parametrized build is node type: name: ENFORCED_NODE, fill the rest as wanted
  4. Use it as follow into the scripted pipeline Jenkinsfiles: 
println("Enforced node: $ENFORCED_NODE")
node(!ENFORCED_NODE ? 'windows && x64' : ENFORCED_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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f39b4b3d-bf6a-4e2f-9498-9b98dd44bcae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.