Re: Getting closure to work Pipeline

2018-08-28 Thread Hari Krishna Dara
I found the closure composition feature and it works well for the use case that I had in mind. However, it would be interesting to understand why the below fails. Should I create a bug? On Monday, August 27, 2018 at 12:26:32 PM UTC+5:30, Hari Krishna Dara wrote: > > I am trying out an approach i

Getting closure to work Pipeline

2018-08-26 Thread Hari Krishna Dara
I am trying out an approach in which the caller receives a closure as a return value from a function so that the context can be preserved for further call chaining. I tried the below as a test and it didn't work: def prep() { return [run: {-> echo "Hello Closure"}] } pipeline { agent "a