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

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

问题描述

任何人都可以解释jenkins中执行groovy脚本和执行系统groovy脚本之间的区别吗?以及如何使用执行系统groovy脚本将脚本调用到slave。



提前致谢 解决方案

要在从机上执行groovy脚本,你应该使用 groovy插件

a>

引用


简单的Groovy脚本分叉JVM,在构建
的slave上运行。这与运行groovy
命令并传入脚本基本相同。


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


系统groovy脚本OTOH在Hudson主JVM中运行。
因此它可以访问Hudson的所有内部对象,所以你
可以用它来改变Hudson的状态。它类似于
Jenkins脚本控制台功能。



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.

Thanks in advance

解决方案

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

Quote

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

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.

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

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