How to define LabelParameterValue in Jenkinsfile

245 views
Skip to first unread message

Kai Wang

unread,
Nov 2, 2017, 9:09:46 PM11/2/17
to Jenkins Users
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.
Reply all
Reply to author
Forward
0 new messages