Jenkins pipeline library configurations
Learn how to configure Jenkins to provide pipeline libraries.
You can configure Jenkins to provide pipeline libraries from DevOps Code ClearCase® SCM, either through a Jenkins configuration or through a Jenkinsfile scripting language library configuration statement. For more information on the pipeline library concept, see full details at https://www.jenkins.io/doc/book/pipeline/shared-libraries/.
![build steps](images/library-exampleDev.gif)
The default version in the pipeline library configuration is ignored by DevOps Code ClearCase. Instead, the version of the library is determined by the stream in the DevOps Code ClearCase UCM configuration. The DevOps Code ClearCase configuration must include a VOB path in the Paths to copy into the workspace section, and also must include a Library Path in the library configuration. Both paths should be the same view-relative path names to the pipeline script library, such as vobs/libraries/jenkins-pipeline-library.
library identifier: 'jenkins-pipeline-library@stream-selected', retriever: legacySCM(
scm: [$class: 'com.hcl.express.jenkins.scm.VersionVaultScm',
destroyViewsRequested: true,
ccScmType: [ $class: 'com.hcl.express.jenkins.scm.config.CcScmTypeUCM',
streamVobTag: "stream:library@/vobs/libraries",
createBaselineRequested: false,
recommendBaselineRequested: false
] ,
copyPaths: [ [$class: 'com.hcl.express.jenkins.scm.VersionVaultScm$RelativePathnameEntry', vobPathName: "vobs/libraries/jenkins-pipeline-
library" ]],
buildViewType: [ $class: 'com.hcl.express.jenkins.scm.config.BuildViewTypeAutomatic',
disableSSLVerification: false, //automatic/web only
credentialsId: "ACCOUNTNAME", //automatic/web only
serverUrl: "WAN_SERVER_URL", //automatic/web only
viewStgLoc: "STORAGE_LOCATION_NAME", //snapshot/dynamic only
checkoutIntoWSRoot: false, // web/snapshot only
reuseDynamicView: false, // dynamic only
vobList: [ [$class: 'com.hcl.express.jenkins.scm.VersionVaultScm$AbsolutePathnameEntry', vobPathName: "/vobs/libraries" ]]
],
], libraryPath: 'vobs/libraries/jenkins-pipeline-library')
checkoutIntoWSRoot: "Erase the Jenkins workspace and load the view in its place" [must be false]
copyPaths: "Paths to copy into workspace"
createBaselineRequested: "Create baseline if applicable" [must be false]
credentialsId: "Credentials"
disableSSLVerification: "Disable SSL Verification"
destroyViewsRequested: "Destroy views on job completion" [must be true]
recommendBaselineRequested: "Recommend baseline if build succeeds" [must be false]
reuseDynamicView: "Reuse existing dynamic view" [must be false]
serverUrl: "Wan server URL"
streamVobTag: "Stream selector"
viewStgLoc: "Enter view storage location name"
vobList: "Enter VOB Path"
buildViewType
can be one of the following:
com.hcl.express.jenkins.scm.config.BuildViewTypeAutomatic
com.hcl.express.jenkins.scm.config.BuildViewTypeDynamic
com.hcl.express.jenkins.scm.config.BuildViewTypeSnapshot
com.hcl.express.jenkins.scm.config.BuildViewTypeWeb