jenkins中的执行groovy脚本和执行系统groovy脚本之间的区别? [英] Difference between execute groovy script and the execute system groovy script in jenkins?

查看:280
本文介绍了jenkins中的执行groovy脚本和执行系统groovy脚本之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以在jenkins中解释执行groovy脚本和执行系统groovy脚本之间的区别吗?以及如何使用执行系统常规脚本将脚本调用为从属脚本.

Can anyone explain the different between the execute groovy script and the execute system groovy script in jenkins? And how to call the script to slave using execute system groovy script.

推荐答案

要在从属计算机上执行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.

这篇关于jenkins中的执行groovy脚本和执行系统groovy脚本之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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