Table of Contents

Shared Libraries

General Information

Jenkins shared libraries are re-usable custom steps, variables, functions, and classes.

Checklist


Shared Library Git Project

Create a new git project that will contain the Jenkins shared library.

Directory structure:


Example: https://gitlab.com/whowe/jenkins-shared-library


Jenkins Server: Configure Shared Library

Edit the Jenkins server settings to be able to use the shared library


Jenkins Pipeline: Import Shared Library

Configure a Jenkinsfile pipeline to use the shared library and then access the custom step via its filename (minus extension).


Example: