2016-09-30 136 views
1

我想选择我的Groovy脚本中的所有选项,因此它默认为all。我正在使用主动选择反应参数,因为我正在阅读前面的选项。我如何使我的“输出”变量,所以它被选中而没有让用户全部选中它们?在Jenkins Groovy中选择所有选项

def output = [] 
def line 
def release = RELEASE_NUMBER 
releaseNumber = release.replaceAll("\\n", ""); 
String[] number = releaseNumber.split("\\."); 

def list = "cmd /c e:\\tools\\wget --no-check-certificate --http-user=username--http-password=password-qO- \"https://1.1.1.1:443/svn/Instructions/trunk/${number[0]}.${number[1]}.${number[2]}/ICAN/EI_${releaseNumber}.txt\"".execute().text 
list.eachLine { 
    if (it.contains("- LH")) { 
     String newName = it.replaceAll("\\s", ""); 
     String newName2 = newName.replaceAll("-", ""); 
     output.add(newName2) 
    } 
} 
return output 

回答

2

我不知道詹金斯什么,但阅读the documentation for the plugin you mention你应该能够简单地使用output.add("${newName2}:selected")

+0

谢谢。这确实有帮助,我得到了它的工作。 –

+0

好吧,很高兴帮助。那么你能接受答案吗? – sensei