jenkinsci / jenkinsci/workflow-basic-steps-plugin
[JENKINS-46124] EnvStep convert map to list
- Dominant language
- Java
- Stars
- 73
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
Currently EnvStep only accepts String array.
But it would be nice if it could accept Map too
and convert it to a String array.
Right now I have to do this in a shared library.
def call(Closure body) {
deleteDir()
def scmVars = checkout scm
def list = []
scmVars.each { k, v -> list << "${k}=${v}" }
withEnv(list) {
body()
}
}
---
Originally reported by
casz, imported from: EnvStep convert map to list
jetersen
Raw content of original issue
Currently EnvStep only accepts String array.
But it would be nice if it could accept Map<String, String> too
and convert it to a String array.Right now I have to do this in a shared library.
def call(Closure body) {
deleteDir()
def scmVars = checkout scm
def list = []
scmVars.each { k, v -> list << "${k}=${v}" }
withEnv(list) {
body()
}
}
Contributor guide
Assessment
This issue has not been assessed yet.