Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44075

Global Pipeline Libraries check out wrong branch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor 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

       

            Unassigned Unassigned
            zdtsw Wen Zhou
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: