I use a shared jenkins library and clone another git repo from there. That repo contains a jenkinsfile similar to the follwing:
#!/usr/bin/env groovy
@Library('mylib')
import jLib.*
someStage{
myparam = someValue
}
I want to read "someValue". Currently I'm doing this with a regexp but this way I can only retrieve a String and not more complex values like a map.
In the documentation of Shared jenkins libs values are loaded from a jenkinsfile the following way:
def call(body) {
// evaluate the body block, and collect configuration into the object
def config = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()
}
How can I extract values from the Jenkinsfile in the workspace in a similar manner? Where does the body come from?
Thank you for your time