jenkins 共享库文件存储在哪里? [英] Where does the jenkins shared library files get stored?

查看:23
本文介绍了jenkins 共享库文件存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jenkins 中的共享库文件是在作业开始时加载的,存放在哪里?我正在尝试访问存储在共享库中的 dockerfile,我需要在 docker build 命令中提供路径.有没有办法在jenkins中找到共享库文件的加载位置?

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?

推荐答案

如果共享库是从 SCM 加载的,并且您的工作区路径是 jenkins/workspaces/jobName,则将副本签出到jenkins/workspaces/jobName@libs 或类似的(如果该路径被另一个并发构建占用,则可能以数字为后缀).

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).

但是,还有另一种方法,如果我理解正确,您不想在这个库中检索资源吗?在这种情况下,您应该使用 libraryResourcewriteFile 步骤.像这样:

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")

这篇关于jenkins 共享库文件存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆