问题
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?
回答1:
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")
来源:https://stackoverflow.com/questions/42426638/where-does-the-jenkins-shared-library-files-get-stored