如何在Jenkins服务器上本地执行groovy脚本

use*_*692 1 groovy jenkins jenkins-cli

我已经安装并运行了 Jenkins,我尝试在本地 Jenkins 服务器本身上运行 Groovy 脚本:

java -jar jenkins-cli.jar  -s http://localhost:8080/ -auth admin:password groovy test.groovy
Run Code Online (Sandbox Code Playgroud)

但我得到了:

ERROR: This command is requesting the -remoting mode which is no longer supported. See https://jenkins.io/redirect/cli-command-requires-channel

那么如果我想在Jenkins服务器本地执行Groovy脚本,而不是通过诸如 之类的接口JENKINS_URL/script,我该怎么办?

谁能帮我 ?谢谢

ere*_*mel 7

尝试使用:

jar jenkins-cli.jar  -s http://localhost:8080/ -auth admin:password groovy = < test.groovy
Run Code Online (Sandbox Code Playgroud)

归功于cli ibook,另请参阅 http://localhost:8080/cli/command/groovy