Jenkins Job DSL-从git repo加载groovy库 [英] Jenkins Job DSL - load groovy library from git repo
问题描述
我想使种子工作尽可能小,并将所有逻辑保留在中央git存储库中.另外,我有几个独立的Jenkins实例,然后可以共享代码.如何在Jenkins Job DSL脚本中加载Groovy库?
I want to keep my seed job as small as possible and keep all the logic in a central git repository. Also, I have several independent Jenkins instances that then could share the code. How can I load a groovy library in a Jenkins Job DSL script?
是否存在类似于管道远程文件加载器插件的内容,因此您只需要执行fileLoader.fromGit('lib.groovy', 'https://git.repo')
?
Is there something like the Pipeline Remote File Loader Plugin, so that you only need to do fileLoader.fromGit('lib.groovy', 'https://git.repo')
?
推荐答案
作业DSL Gradle示例显示了如何在Git存储库中维护DSL代码.
The Job DSL Gradle Example shows how to maintain DSL code in a Git repository.
这篇关于Jenkins Job DSL-从git repo加载groovy库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!