Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Latest commit

 

History

History
32 lines (24 loc) · 806 Bytes

UsingTheSharedLib.md

File metadata and controls

32 lines (24 loc) · 806 Bytes
description
How to use the Jenkins Shared Library within your project.

DevOps Jenkins Shared Library Repository

https://github.com/BCDevOps/jenkins-pipeline-shared-lib.git

Using the shared Library in your Jenkinsfile

Add the line below to import the shared library

library identifier: 'devops-library@master', retriever: modernSCM(
  [$class: 'GitSCMSource',
   remote: 'https://github.com/BCDevOps/jenkins-pipeline-shared-lib.git'])

Example:

library identifier: 'devops-library@master', retriever: modernSCM(
  [$class: 'GitSCMSource',
   remote: 'https://github.com/BCDevOps/jenkins-pipeline-shared-lib.git'])
   
stage('testing lib') {
    def TIMESTAMP = getTimeStamp();
    echo "${TIMESTAMP}"
}

References:

https://jenkins.io/doc/book/pipeline/shared-libraries/