Jenkins Job DSL-从git repo加载groovy库 [英] Jenkins Job DSL - load groovy library from git repo

查看:208
本文介绍了Jenkins Job DSL-从git repo加载groovy库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使种子工作尽可能小,并将所有逻辑保留在中央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屋!

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