DEV Community

Discussion on: Centralise Jenkins Pipelines configuration using Shared Libraries

Collapse
 
gprasanthkumar profile image
Guddanti Prasanth Kumar

Hi Juan,

I have gone through this post and very much excited to implement it in part of my projects.

Everything works super... till one point.

Is it possible to make standardPipeline.groovy return some value(A collection Object) and capture that in the Jenkinsfile and pass it as an argument to another groovy script which is in a shared library?

/Prasanth

Collapse
 
jalogut profile image
Juan Alonso

Hi Prasanth,

Sorry for my late reply. To be honest, I have not idea about that. That was not needed in my case. You can pass parameters from your Jenkinsfile to the shared library but not sure about the other way around. Maybe if elaborate your specific need, we find another way to do it without that.

Collapse
 
gprasanthkumar profile image
Guddanti Prasanth Kumar

Hi,

Sorry for my reply as well...

I was trying to do some modifications to an class object in a library function and explicitly returned the same object to use in the pipeline in the later stages and I could do it with defining the appropriate return type(though def works).

Now it works as expected.