====== Shared Libraries ====== **General Information** Jenkins shared libraries are re-usable custom steps, variables, functions, and classes. **Checklist** * Jenkins server setup/configured * Jenkins pipeline job(s) configured ---- ====== Shared Library Git Project ====== Create a new git project that will contain the Jenkins shared library. Directory structure: * vars/ -> Custom steps in .groovy format * src/ -> Other common code (classes, metadata) \\ 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 * Manage Jenkins * Configure System * Under "Global Pipeline Libraries", click "Add" * Library * Name: (will be used in Jenkinsfiles to access shared library) * The example pipeline below assumes the library name is: "library-example" * Default version: (example: master) * Retrieval method * Select "Modern SCM" * Select "Git" or "GitHub" * Project Repository: * Credentials: