Jenkins - 从文件系统而不是 SCM 加载全局管道库? [英] Jenkins - load global pipeline library from filesystem instead of SCM?
问题描述
我在文档中找不到有关如何执行此操作的任何内容 - 有人有什么想法吗?
I can't find anything in the docs on how to do this - anybody have any ideas?
推荐答案
目前看来不可能.但是您可以轻松地初始化本地 git 存储库并将其用作 SCM,而无需任何远程托管.
要初始化 git repo,请在共享库的根目录中使用以下命令(例如 C:UsersJenkinspipeline-shared-library-test):
It seems it is currently not possible. But you can easily init a local git repository and use it as SCM without any remote hostings.
To init a git repo use the following commands in the root directory of your shared library (for example C:UsersJenkinspipeline-shared-library-test):
git init
git add .
git commit -m "init"
然后在 Manage Jenkins->Configure System->Global Pipeline Libraries
中,您可以使用文件 URI file 将
Project Repository
指向您的本地 repo:///c:/Users/Jenkins/pipeline-shared-library-test
这种方法对我来说很好.
Then in Manage Jenkins->Configure System->Global Pipeline Libraries
you can point Project Repository
to you local repo using a file URI file:///c:/Users/Jenkins/pipeline-shared-library-test
This approach works fine for me.
这篇关于Jenkins - 从文件系统而不是 SCM 加载全局管道库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!