Skip to content

rlenferink/jenkins-shared-library-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Example of a groovy library that can be re-used in a Jenkins environment (e.g. by the pipeline-global-lib-nexus-plugin)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages