且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jenkins中的执行groovy脚本和执行系统groovy脚本之间的区别?

更新时间:2023-12-05 14:18:28

要在从属计算机上执行Groovy脚本,应使用

To execute a groovy script on the slave machine, you should use groovy plugin

报价

普通的"Groovy脚本"在派生的JVM中在从属服务器上运行, 构建运行.与运行"groovy"基本相同 命令并传入脚本.

The plain "Groovy Script" is run in a forked JVM, on the slave where the build is run. It's the basically the same as running the "groovy" command and pass in the script.

问题的第一部分在同一页面中回答

First part of your question is answered in the same page

系统常规脚本OTOH在Hudson主服务器的JVM中运行. 因此,它将可以访问Hudson的所有内部对象,因此您 可以使用它来更改哈德森的状态.它类似于 Jenkins脚本控制台功能.

The system groovy script, OTOH, runs inside the Hudson master's JVM. Thus it will have access to all the internal objects of Hudson, so you can use this to alter the state of Hudson. It is similar to the Jenkins Script Console functionality.