1

I currently have my groovy script in workspace under sdkTools/tools/at-jenkins/helloWorld.groovy

I dont know in what form this file path needs to be enter image description here

I have tried:

$WORKSPACE/sdkTools/tools.....

sdkTools/tools...

/sdkTools/tools...

../helloWorld.groovy

None worked. Script contains simple return of HelloWorld text. I tried putting same script into "Groovy Script" option and it worked.

return "hello world"

enter image description here

As you can see nothing shows on Dialog_test parameter if groovy file is selected.. But if I hardcore script I get hello world there.

Any help is much appreciated

4

1 回答 1

0

您需要使用完整路径。它不会第一次起作用,因为脚本需要先获得批准。但是,我建议使用Scriptler plugin,这样脚本会立即获得批准。Scriptler 在 中创建脚本/var/lib/jenkins/scriptler/scripts,所以如果你创建test脚本,你需要在扩展选择参数配置中使用它的绝对路径和扩展名 - /var/lib/jenkins/scriptler/scripts/tets.groovy,所以它看起来像: 在此处输入图像描述

于 2021-01-12T09:14:56.393 回答