Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the jenkins shared library files get stored?

The shared library files in jenkins are loaded at the beginning of the job, where does it get stored? I am trying to access the dockerfile stored in the shared library, I need the path to give in the docker build command. Is there a way I can find out the place where the shared library files are loaded in jenkins?

like image 482
AshJune Avatar asked Feb 23 '17 21:02

AshJune


1 Answers

If the shared library is loaded from SCM and your workspace path is jenkins/workspaces/jobName, then a copy is checked out to jenkins/workspaces/jobName@libs or similar (might be suffixed with a number if that path is occupied by another concurrent build).

However, there is another way, if I understand you correctly you wan't to retrieve a resource in this library? In that case you should use the libraryResource and writeFile steps. Like this:

writeFile file:'myFile.txt', text:libraryResource("path/to/myFile.txt")
like image 77
Jon S Avatar answered Sep 19 '22 07:09

Jon S