导出和导入Jenkins Pipeline脚本批准 [英] Exporting and Importing Jenkins Pipeline script approvals

查看:315
本文介绍了导出和导入Jenkins Pipeline脚本批准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我们的Jenkins构建过程,我有大量的Groovy管道脚本.我正在将这些脚本移到另一个实例上,并希望复制最初未列入白名单的已批准脚本集.

I have a significant set of Groovy pipeline scripts for our Jenkins build process. I am in the process of moving those scripts onto another instances, and would like to replicate the set of approved scripts that were not originally white listed.

是否可以导出已批准签名的列表并将其导入另一个实例?

Is it possible to export the list of approved signatures and import them into another instance?

我唯一的其他解决方案是不断运行和重新运行脚本,并在每个签名破坏构建时批准它们.由于脚本非常复杂,并且不能保证每次运行都符合要求,所以这不是一个快速的过程.

The only other solution I have is to constantly run and rerun the scripts and approving each signature as it breaks the build. Since the scripts are quite complex, and not every run is guaranteed to hit each line, this is not going to be a quick process.

另一种选择是创建一个主白名单"脚本,该脚本一次又一次运行所有当前未批准的脚本,直到所有实例都获得批准为止.

The other option would be to create a master 'white list' script which runs all the currently non-approved scripts again and again until all instances had been approved.

这两个选项都不是很好的选择,因此,我希望进行简单的导入/导出操作,以避免完全一起进行此工作,但是我当然看不到用户界面中有可用的选项.

Neither of these options is great, so I'm hoping for a simple import/export to avoid having to do this work altogether, but I certainly can't see an option available to be in the UI.

欢呼

推荐答案

我不认为默认情况下具有导入/导出功能,但也许会有一个插件可以做到这一点.

I do not believe there is import/export functionality by default but maybe there's a plugin that'll do it.

如果您有权访问Jenkins的安装目录或运行目录,则应该能够找到scriptApproval.xml文件.

If you have access to the directory Jenkins' is installed or runs in you should be able to find the scriptApproval.xml file.

如果您发现它会找到approvedScriptHashesapprovedSignatures等,则可以完全抬起该文件并将其粘贴到新实例中,或在所需的详细信息中进行复制(无论哪种方式都需要重新启动)

If you explore that you'll find approvedScriptHashes and approvedSignatures etc. You can lift this file entirely and paste it in the new instance or copy across the specifics you need (either way you'll need a restart).

此处

这篇关于导出和导入Jenkins Pipeline脚本批准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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