Where does the jenkins shared library files get stored?

﹥>﹥吖頭↗ 提交于 2020-07-06 09:47:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!