global shared library overrides folder shared library?

92 views
Skip to first unread message

Torsten Reinhard

unread,
Nov 22, 2016, 9:34:31 AM11/22/16
to Jenkins Users
Hi all,

in our Jenkins Setup we are currently using the "internal shared library", which is implicit accessible via its "master" Branch.
Pipelines using that code are working fine.

Now, I´ve cloned that repo into a BitBucket Repo for "pretesting" changes with a demo project that resided in a "Folder" inside Jenkins.
I´ve configured this folder to provide a "shared library" :

Name: cd_workflowlibs
Default version: master
Load implicitely: true
Allow default version to be overridden: true

The Url is like: ssh://g...@licdci01.mycompany.net:7999/cd/workflowlibs.git
Branches to build: origin-bitbucket/master

When starting my pipeline, the library seems to be loaded correctly:

Loading library cd_workflowlibs@master
 
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 
> git config remote.origin-bitbucket.url ssh://g...@licdci01.mycompany.net:7999/cd/workflowlibs.git # timeout=10
Fetching upstream changes from ssh://g...@licdci01.mycompany.net:7999/cd/workflowlibs.git
 
> git --version # timeout=10
using GIT_SSH to set credentials SSH Bitbucket Access
 
> git -c core.askpass=true fetch --tags --progress ssh://g...@licdci01.mycompany.net:7999/cd/workflowlibs.git +refs/heads/*:refs/remotes/origin-bitbucket/*
 
> git rev-parse refs/remotes/origin-bitbucket/master^{commit} # timeout=10
 
> git rev-parse refs/remotes/origin-bitbucket/origin-bitbucket/master^{commit} # timeout=10
Checking out Revision 205f22f3563b2c5b224e41fdd8c53d1c22b041d2 (refs/remotes/origin-bitbucket/master)
 
> git config core.sparsecheckout # timeout=10
 
> git checkout -f 205f22f3563b2c5b224e41fdd8c53d1c22b041d2

The weird thing now is, that new scripts will be executed properly - but changes made to "old", existing scripts aren´t reflected.
It seems like the "old" scripts are still being used from the global, internal shared library location (where changes are not yet pushed).

How can I disable any script coming from the internal shared library ? Is there a way to detect, which version (checksum?) of the script is really being used?
For me it seems like a class-loading issue - and scripts from the internal shared library will be picked up, 1st.

Any ideas ?

Thanx, Torsten



Torsten Reinhard

unread,
Nov 25, 2016, 3:48:14 PM11/25/16
to Jenkins Users
After some tests I found, that scripts from the internal shared library were choosen. This behaviour cannot be overriden.

created an improvement issue for that: https://issues.jenkins-ci.org/browse/JENKINS-40046
=> would be helpful to disable the internal repo - and/or to improve the logs so its clear which scritps are choosen.
Reply all
Reply to author
Forward
0 new messages