0
votes

We have a Jenkins scripted pipeline with 6 stages. I need to call a REST api at the end of each stage to push the status of the stage to Cassandra DB. Is there an efficient way of doing this in Jenkins Pipeline?

Currently, I am calling a function at the end of each stage with the status. I have to write this piece of code in all stages even if the stage succeeds or fails.

1

1 Answers

0
votes

did you try to use the shared library function, to write you code once and call it all over the pipeline eg. in diffent pipelines? Here is the link to the docs. https://jenkins.io/doc/book/pipeline/shared-libraries