我正在嘗試使用Active Choices插件通過使用github api的回購獲取分支列表,但它給了我一個沒有回購的錯誤 - 這是一個引用參數,它是已經定義。主動選擇插件 - 找不到引用參數
如果我使用的是Ubuntu 16.0.4,Jenkins 2.32.2和Active choices plugin 1.5.3。
if (REPO.equals("REPOA")){
def proc = "curl https://api.github.com/repos/jenkinsci/active-choices-plugin/branches | jq -r '[.[] | .name ]'".execute()
return proc.text
}
else if (REPO.equals("REPOB")){
def proc = "curl https://api.github.com/repos/jenkinsci/active-choices-plugin/branches | jq -r '[.[] | .name ]' ".execute()
return proc.text
}
我做錯了什麼? (我也嘗試使用緩衝區/流的方式,因爲我發現了一些關於不使用'text'從stackoverflow的答案,但結果相同。獲取分支名稱的代碼部分在腳本編輯模式下工作正常。)
def proc ="curl...."
def outputStream = new StringBuffer()
proc.waitForProcessOutput(outputStream, System.err)
return outputStream.toString())
referenced parameter reactive part
的錯誤是如下:
Fallback to default script...
groovy.lang.MissingPropertyException: No such property: REPO for class: Script1
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
at Script1.run(Script1.groovy:1)
您應該通過編輯添加實際答案,而不是作爲評論。歡迎來到SO,順便:) –
完成。謝謝你的提示 :) – Havri