2016-09-30 133 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