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

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

问题描述

谁能解释一下jenkins中execute groovy脚本和execute system groovy脚本的区别?以及如何使用execute system groovy脚本调用脚本到slave.

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 脚本,您应该使用 groovy 插件

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

引用

简单的Groovy Script"运行在一个分叉的 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

系统 groovy 脚本 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天全站免登陆