-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Jenkins 2.46.2
Pipeline: Shared Groovy Libraries: 2.7
In Jenkins' global config set "docs" as default branch in section "Global Pipeline Libraries" for Libraries "deliveryLib"
enabled "Allow default version to be overridden"
Use "Legacy SCM" along with "Git" and add into "Branches to build" section with mutlit-branches: e.g */master */docs */fixes
In Jenkinsfile, tried out different combinations.e.g:
@Library('deliveryLib@master')
or
@Library('deliveryLib@origin/master')
or
@Library('deliveryLib@fixes')
but all failed, as log shows:
Checking out Revision *************** (origin/docs)
Not 100% sure, if this error was caused by
system cached last time "default branch name"
or
the overwritten functions not work
or
checkout was sorted by some alphabet order
Current solution is, to remove other branches name, but only leave the one really want to use in system config, followed a jenkins restart
[JENKINS-44075] Global Pipeline Libraries check out wrong branch
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Read the documentation for Legacy SCM: