Sorry the post reply got pressed by accident.  Here is what I have which 
does not work:

def call(String buildType, String agentLabel=null) {
if ("versionBranch".equals(buildType)) {
 pipeline {
 
   if (agentLabel==null) {
    agent any
   } else {
    agent {label "${agentLabel}"}
   }
   .... rest of the pipeline
 }
}


On Friday, December 27, 2019 at 4:59:13 PM UTC-5, Mario Jauvin wrote:

> I currently use a shared library with a call method.  I would like to 
> specify an argument to either use the agent any or agent {label 
> 'some-label'}.
>
> I have the call method as such:
>
> def call(String buildType, String agentLabel=null) {
> if ("versionBranch".equals(buildType)) {
>
> }
>

-- 
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 
https://groups.google.com/d/msgid/jenkinsci-users/064059a9-532b-4b8b-af94-cf2d2f5b36b9%40googlegroups.com.

Reply via email to