简体   繁体   English

jenkins插件是否有任何pip冻结等效项,可用于在jenkins docker映像中预安装插件?

[英]is there any pip freeze equivalent for jenkins plugins which can be used to pre-install plugins in jenkins docker image?

In python world there is useful tool like pip freeze which dumps all currently installed python packages into a core-support plugin format. 在python世界中,有一个有用的工具,例如pip freeze ,它将当前安装的所有python软件包转储为核心支持插件格式。 This dump can then be used to configure a new virtual environment for a new python installation. 然后,可以使用此转储为新的python安装配置新的虚拟环境。

Is there anything similar for Jenkins docker images? Jenkins docker镜像是否有类似内容?

I understand from the official jenkins docker image docs that it can accept a core-support plugin format file to pre-install plugins. 我从官方的jenkins docker图像文档中了解到,它可以接受核心支持的插件格式文件来预安装插件。 How can i generate that file myself from an existing jenkins installation that i already have? 我如何从已经拥有的现有jenkins安装中自己生成该文件?

The following Groovy code can be entered into the Script Console available under Manage Jenkins and will output said list: 可以在Manage Jenkins下的脚本控制台中输入以下Groovy代码,并输出上述列表:

Jenkins.instance.pluginManager.plugins.sort().each{ plugin ->
  println "${plugin.getShortName()}:${plugin.getVersion()}"
}

ace-editor:1.1 王牌编辑:1.1
analysis-collector:1.49 分析收集器:1.49
analysis-core:1.81 分析核心:1.81
ansicolor:0.4.3 ansicolor:0.4.3
... ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM