0
我設置這樣的詹金斯管道Groovy的傳遞陣列的功能
def tags = [
"zookeeper",
"postgres",
"postgres-maps",
"kudu-master",
"redis-master",
"consul",
"dcos-bootstrap"]
數組我試圖把它傳遞到一個函數像
run_linux("${tags}")
我的功能看起來像
def run_linux(tags) {
def tasks = [:]
for (i = 0; i < tags.size(); i++) {
def tag = "${tags[i]}"
tasks["${tag}"] = {
stage ("${tag}"){
sh ..
}
}
所以它看起來像詹金斯是這樣的
[Pipeline] [[] stage
[Pipeline] [[] { ([)
[Pipeline] [z] stage
[Pipeline] [z] { (z)
[Pipeline] [o] stage
[Pipeline] [o] { (o)
[Pipeline] [k] stage
[Pipeline] [k] { (k)
它似乎是治療什麼傳遞作爲一個字符串,而不是一個數組。