I'm setting an array like this
def tags = [
"zookeeper",
"postgres",
"postgres-maps",
"kudu-master",
"redis-master",
"consul",
"dcos-bootstrap"]
I'm trying to pass it into a function like
run_linux("${tags}")
My function looks like
def run_linux(tags) {
def tasks = [:]
for (i = 0; i < tags.size(); i++) {
def tag = "${tags[i]}"
tasks["${tag}"] = {
stage ("${tag}"){
sh ..
}
}
So what it looks like in jenkins is this
[Pipeline] [[] stage
[Pipeline] [[] { ([)
[Pipeline] [z] stage
[Pipeline] [z] { (z)
[Pipeline] [o] stage
[Pipeline] [o] { (o)
[Pipeline] [k] stage
[Pipeline] [k] { (k)
It seems to be treating what got passed in as a string not an array.