I've been using Jenkins shared libraries for quite a while, but something 
just popped up which is confusing me quite a bit. Instead of just creating 
steps, I'm now trying to create a full declarative pipeline inside the 
shared library.


In any case, what I'm finding is that this works great when my pipeline is 
defined directly inside the call method. As soon as I do a simple function 
call, I get errors like:


hudson.remoting.ProxyException: groovy.lang.MissingPropertyException: No such 
property: any for class

To be clear, here is working code:

def call() {
  pipeline {
    agent any

    stages {
      stage("Stage") {
        steps {
          echo "hi"
        }
      }
    }
  }
} 


And here is non-working code:

def call() {
  execute()
}

def execute() {
  pipeline {
    agent any

    stages {
      stage("Stage") {
        steps {
          echo "hi"
        }
      }
    }
  }
} 


For reasons beyond this post, we are trying to add some commonality and 
argument checking to our steps, which is why I'd like to be able to use 
that concept of the extra function call..


Any help/pointers would be much appreciated.


Thanks!

Chris

-- 
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/4ca259ae-831f-4b3a-9075-2af8e2afef1ao%40googlegroups.com.

Reply via email to