我正在尝试运行一个groovy脚本,它在从节点上运行一个进程时,在执行过程中更新build.description
。
我的问题是,“系统groovy脚本”只在主节点上执行,而“Jenkins groovy脚本”在从节点上运行,但无法访问build
变量。
我有一个类似的脚本:
import hudson.model.*
// works on slave node
def param = args[0]
// works on master node
//def param = build.getEnvironment(listener).get('Params')
def ws = new File(".").absolutePath
def myCommand = ws + "\\Something.exe " + param
def proc = myCommand.execute();
// Cannot use on slave
build.description = "Running executable..."
int exitVal = proc.waitFor();
// Cannot use on slave
build.description = "Executable finished"
字符串
有没有一种方法可以修改在从站上运行的“Jenkins Groovy Script”上的构建变量?
1条答案
按热度按时间92dk7w1h1#
号
Jenkins pipeline在这些事情上提供了更多的控制。
下面是从脚本中我们有.
nodeexpression
可以是一个节点名。字符串