10
Shared Libraries
As we start to use Groovy code to write the pipeline logic, it's inevitable that we'll end up repeating the same code across multiple pipelines. As programmers, we naturally look for ways to write functions, classes, and methods to organize repeated code. Shared libraries provide a way to encapsulate the repeated code and create helper functions, but that is only the beginning of what shared libraries can do.
The power of shared libraries is twofold. The first half of the chapter will show that there are two different ways of providing a shared library and four or five different ways of using a shared library7. Each of these options comes with slightly different capabilities, and this variety makes shared libraries useful ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access