Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.05 KB

README.md

File metadata and controls

36 lines (23 loc) · 1.05 KB

Jenkins shared library example

This repository contains an example project for deploying a Jenkins shared library to Nexus.

Usage

Library deployment

Upload this library to Nexus using e.g. mvn clean deploy.

Release this library using e.g. mvn release:prepare release:perform.

Plugin and library configuration

Then, in Jenkins, ensure that the pipeline-global-lib-nexus-plugin is installed.

In Jenkins, navigate to 'Manage Jenkins -> Configure System' and scroll down to ' Global Pipeline Libraries'. Add the library using the following details (one time):

Library Name: jenkins-lib
Default version: develop
Retrieval method: Nexus
Artifact details: com.roylenferink.jenkins.libraries:jenkins-shared-library-example:${library.jenkins-lib.version}:zip
MAVEN_HOME: /tools/maven/3.9.0/

Library usage

The library can now be used in pipeline jobs. E.g. create a new pipeline job with the following pipeline script:

library 'jenkins-lib@1.0.6'
examplePipeline()