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
謝謝。這確實有幫助,我得到了它的工作。 –
好吧,很高興幫助。那麼你能接受答案嗎? – sensei