Skip to content

Commit

Permalink
Support miltivalue for attributes and constants (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikRehmTT committed Sep 12, 2024
1 parent c592f50 commit 1b83040
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions vars/pipeline2ATX.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ def getBuildAttributes(build, customAttributes) {
JENKINS_URL: build.getAbsoluteUrl(),
JENKINS_WORKSPACE: env.WORKSPACE,
TEST_LEVEL: env.TEST_LEVEL] + customAttributes
return attributes.findAll{k,v -> v}.collect{ k, v -> [key: k, value: v.toString()]}
return attributes.findAll{k,v -> v}.collect{ k, v ->
if (v instanceof List) {
return [key: k, value: v.collect{it.toString()}]
}
return [key: k, value: v.toString()]
}
}

/**
Expand All @@ -150,7 +155,12 @@ def getBuildConstants(build, customConstants) {
JENKINS_BUILD_ID: build.id,
JENKINS_EXECUTOR_NUMBER: env.EXECUTOR_NUMBER,
JENKINS_NODE_NAME: env.NODE_NAME] + customConstants
return constants.findAll{k,v -> v}.collect{ k, v -> [key: k, value: v.toString()]}
return constants.findAll{k,v -> v}.collect{ k, v ->
if (v instanceof List) {
return [key: k, value: v.collect{it.toString()}]
}
return [key: k, value: v.toString()]
}
}

/**
Expand Down

0 comments on commit 1b83040

Please sign in to comment.