How to define LabelParameterValue in Jenkinsfile

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

How to define LabelParameterValue in Jenkinsfile

Kai Wang
Hi,

I have two jobs A and B. Job A calls Job B like this

build job: "B", parameters[[$class: 'LabelParameterValue', name: 'node', label: "${env.NODE_NAME}"]]

I know I am supposed to add a Label parameter in B. But the problem is B is a multiple branch pipeline project defined by Jenkinsfile.

So the question is, how do I define a Label parameter in Jenkinsfile? I tried 

parameters {
        LabelParameterValue(name: 'node', label: '')
    }

But I got the error:

WorkflowScript: 11: Invalid parameter type "Label". Valid parameter types: [booleanParam, choice, credentials, file, text, password, run, string] @ line 11, column 9.
           Label(name: 'node', label: '')
           ^

Thanks for the help.

--
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/aeac1bc6-5bac-405b-afca-957eed19d6c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.