Details
-
Type:
New Feature
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Not A Defect
-
Component/s: declarative-pipeline-when-conditions-plugin, pipeline
-
Similar Issues:
Description
I want to specify a method in jenkinsfile, which will be part of my source code and I want to call that method at any specific stage in Shared-library. Is there anyway, we could do that in case of "declarative pipelines" .
Can I create a method inside the build pipeline shown in below attachment
Srinath Palasani I think you might want to have a method or custom step in the shared library that takes a block/closure as argument (which in turn executes the project or concrete Jenkinsfile specific code), see e.g. https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-custom-steps