如何从命令行安装 jenkins 插件? [英] How to install jenkins plugins from command line?

查看:42
本文介绍了如何从命令行安装 jenkins 插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何选项可以从命令行安装 jenkins 插件?

Is there any option to install jenkins plugins from command line ?

我在谷歌搜索后找到了一个命令:

I found a command for this after a bit google search :

java -jar /var/lib/jenkins/jenkins.war -s http://127.0.0.1:8080/ install-plugin ${Plugin_Name}

但它不起作用.

推荐答案

根据 Jenkins 命令行界面文档,您需要使用客户端 JAR文件(不是您使用的服务器 WAR文件),您可以直接获取来自詹金斯,例如通过 http://localhost:8080/cli

As per the Jenkins command line interface documentation, you need to use the client JAR file (not the server WAR file you're using), which you can obtain directly from Jenkins, e.g. via the links on http://localhost:8080/cli

然后您可以使用此 JAR 运行命令:

Then you can run the command using this JAR:

java -jar jenkins-cli.jar -s http://127.0.0.1:8080/ install-plugin <name>

这将下载安装您想要的插件及其任何依赖项.

This will download install the plugin you want, along with any of its dependencies.

这篇关于如何从命令行安装 jenkins 插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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