Hi,
I'm writing a pipeline groovy script. and stumbled upon this problem:
If I try to run step within a function, then function is immediately terminated and doesn't execute following instructions.
I.e.
I have function:
@NonCPS
def getBuildOutput(build_job) {
echo "BeforeStep"
def prop_file=readFile('get_src_job_artifacts/output.properties')
echo "AfterStep"
//Execute further processing with non serializable variables
//....
But when I call it, "BeforeStep" is echoed, but "AfterStep" is not.
instead getBuildOutput returns string read from that file.
Why is that, and is there a way to avoid that?