I’m running into a problem with pipeline library branches and I was hoping 
someone could help me understand what I’m doing wrong.

 

Jenkins Version: 2.121.2

 

I have a project configured, and the project has a pipeline library. The 
default version is “master”, load implicitly is not checked, and Allow 
default version to be overridden is checked. The Jenkins job that’s within 
the project does not define a pipeline library.

 

The pipeline job’s Jenkinsfile has:

 

@Library(value=”my_library”, changelog=false)

 

When I run the build, the output shows that the pipeline library being 
executed is “my_library@SomeBranchName”.

 

Similarly, when I reset the Jenkinsfile to include the master branch name:’

 

@Library(value=”my_library@master”, changelog=false)

 

it’s still pulling @SomeBranchName.

 

The way I thought this worked from reading the documentation is that:

 

   1. If a pipeline library is available and has multiple branches, and the 
   default branch is “master”, and the Jenkinsfile references the library and 
   doesn’t add @branchName, then the project should be built using the 
   pipeline library’s master branch. 
   2. If a pipeline library is available and has multiple branches, and the 
   default branch is overridden in the Jenkins file using 
   @Library(value=“my_library@SomeBranch”), then the project should be built 
   using the pipeline library’s specified branch. 

 

Can anyone help me understand how pipeline libraries and branching is 
supposed to work?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c63e4b68-ab75-4376-a2c9-39766bbfd136%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to