Home > Software engineering >  Difference between external and internal library in Jenkins pipeline
Difference between external and internal library in Jenkins pipeline

Time:07-01

I want to understand the difference between external and internal library in Jenkins pipeline. I read the Extending with Shared Libraries. It says about the libraryResource step such:

A resources directory allows the libraryResource step to be used from an external library to load associated non-Groovy files. Currently this feature is not supported for internal libraries.

What do the external and internal mean? I guess that:

  • Internal library is gotten from a repository which is the same with a Jenkinsfile
  • External library is gotten from a repository which is not the same with a Jenkinsfile

Is my understanding right? Thanks.

CodePudding user response:

That line in documentation has been added a 2016, and in the same commit there is a reference to "internal" libraries being "legacy".

I have worked some time with Jenkins Pipeline now, and until now never heard of "internal" Pipelines -- I think for Pipeline Libraries as they are defined in 2022 are always "external".


Edit: Only some month before the line was added to documentation, a [JENKINS-31155] Shared libraries PR was merged to the plugin implementing Shared Libraries.

If you check the readme at that time, it tells:

Defining the internal library

An older mode of sharing code is to deploy sources to Jenkins itself. [...]

Thus:

  • External Library: Pushed to a SCM outside Jenkins.
  • Internal library: Pushed to a Git Repo within Jenkins. (Legacy, not supported anymore)
  • Related