Status: Closed (View Workflow)
Resolution: Cannot Reproduce
Environment:Jenkins 2.19.1(installed via apt)
master and nodes (via ssh): ubuntu 14.04.5 LTS, openJDK 1.8.0_91
pipeline: shared groovy libraries 2.5
pipeline remote loader 1.3
git plugin 3.0.1
My organization has been using Jenkins 2.0 and Pipelines for several months. We've reached a critical point where we need a global library to consolidate functionality and reduce configuration drift of our Jenkinsfiles and scripts. I created a git repo in our Bitbucket team to hold common functions, the first of which are notifications classes for sending build status to Hipchat and Bitbucket (e.g. src/com/team/notifications/Bitbucket.groovy):
Our development workflow depends on Jenkins build approvals of pull requests, using the Bitbucket build status notifier plugin. The above class "works", in that it sends build status notifications to bitbucket, but the problem is that it is always sending those notifications to the shared library repo, not the repo that is being built (e.g. one of our Java libraries or webapps).
I have tested the above library as both a class and as a global var implementation, both explicitly and implicitly loaded into the pipeline script. I have also confirmed that the normal non-shared-library usage of the bitbucket-status-notifier plugin is affected by the shared library git repo, so the plugin can't be used at all, it seems, if there's a shared library brought into a pipeline job. Here's its usage as an explicit library:
As has already been reported on JENKINS-40150 and
JENKINS-41442, the git repo information of the shared library is bleeding into the execution of the pipeline job. We have other pipeline operations that reference Git info, so I am unable to expand actual usage of the shared library to our other projects, with this interference.