如何在没有 classpath字段的情况下为我的Jenkins Jobs DSL groovy脚本加载自定义jar文件?
我继承了一个Jenkins实例。 这个Jenkins实例有一个旧版本的Jenkins Jobs DSL插件 。 此版本的jobs插件具有类路径字段
通过加载此jar文件,我的脚本(在DSL脚本中)具有可导入的其他符号/类。
但是, Jenkins Jobs DSL的最新版本已删除此类路径字段。 我从邮件列表中得到的印象是这是出于安全原因。
没有这个选项,是否可以设置不同的类路径(或者在我的Jenkins Jobs DSL groovy脚本中包含额外的jar文件而没有这个字段?
How can I load a custom jar file for my Jenkins Jobs DSL groovy scripts without the classpath field?
I've inherited a Jenkins instance. This Jenkins instance has an older version of the Jenkins Jobs DSL plugin. This version of the jobs plugin has a class path fields
By loading this jar file, my script (in the DSL Scripts) has additional symbols/classes it may import.
However, the latest versions of the Jenkins Jobs DSL have removed this class path field. The impression I get from the mailing list) is this was done for security reasons.
Without this option, is it possible to set a different class path (or include extra jar files in my Jenkins Jobs DSL groovy scripts without this field?
最满意答案
不,没有任何直接选择。 以下是可用的选项
选项1 :按照Daniel的建议( https://groups.google.com/forum/#!topic/job-dsl-plugin/lYgX3boW0Pk ),您可以使用Script Security Plugin添加自定义类路径并包含jar(s )。 这种方法唯一的开销就是,即使罐子中存在细微差别,也需要批准。
选项2 (最不推荐,最后一个选项):如果您在公司网络下运行Jenkins,并且您对安全性有信心,那么您可以考虑取消选中Jenkins的启用安全工作DSL - >配置全局安全
No, there isn't any direct option available. Following are the options available
Option 1: As Daniel has suggested (https://groups.google.com/forum/#!topic/job-dsl-plugin/lYgX3boW0Pk) , you can use the Script Security Plugin to add custom classpath and include the jar(s). The only overhead with this approach is, even if there is a minor difference in the jar, an approval would be required.
Option 2(Least Preferred, Last Option): If you are running Jenkins under a company network and if your confident on security, then you can consider to uncheck the Enable Security for Job DSL from Jenkins-> Configure Global Secutiry
更多推荐
发布评论