re: Centralise Jenkins Pipelines configuration using Shared Libraries VIEW POST

re: Hi Juan, Thanks a lot for this post, really simple and straight forward. I have a question related to this, as relying much on the shared library...

Hi Abdel,
What I usually do is to add my changes in a new brach of the shared library. Then I take one project and I modify its jenkinsfile to use that new branch. You can do that like that:

@library("your-library-name@BRANCH_NAME") _

After testing that everything works ok, I merge the library changes in master.

Would that work for you?


HI Juan,

Thanks again for your reply, but this is actually what I do in the mean time passing my own branch of the shared library repo, but seems to be very manual to us especially wish a really complex pipeline.

What I meant in my question is can we do any sort of unittest to the pipeline before merging to the shared library master branch

Things like cucumber, maven ...etc have you done any similar testing before for the sharedlibrary repo before as I can see your way is very manual testing and I wish if you had done any automated testing for the pipeline with the shared library.

Again Thanks a lot Juan

Hi Abdel,

No, I do not do any automated tests for the pipeline code itself. If you find a convenient way to do it, Iā€™d love to know more. I think there is something about testing the pipeline code in the following video. Here is the link in case it helps:

code of conduct - report abuse