[JIRA] (JENKINS-60063) Add Signature to withEnv to take Map<String, String>

3 views
Skip to first unread message

jerrywiltse@gmail.com (JIRA)

unread,
Nov 5, 2019, 10:52:04 AM11/5/19
to jenkinsc...@googlegroups.com
jerry wiltse created an issue
 
Jenkins / New Feature JENKINS-60063
Add Signature to withEnv to take Map<String, String>
Issue Type: New Feature New Feature
Assignee: Unassigned
Components: workflow-basic-steps-plugin
Created: 2019-11-05 15:51
Priority: Minor Minor
Reporter: jerry wiltse

We have this utility function in our Jenkins Shared Library:

static List<String> convertMapToJenkinsEnv(Map<String,String> srcEnv) {
    return srcEnv.collect { "${it.key}=${it.value}"}
}

It seems obvious that this could be an alternative signature to the current basic built-in function:

withEnv

For us, it's far more ergonomic to work with and compose maps in our Shared Library and scripted pipelines, taking advantage of it's well-defined characteristics surrounding unique keys etc.

It seems as trivial as it could be to implement this.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jerrywiltse@gmail.com (JIRA)

unread,
Nov 5, 2019, 10:52:05 AM11/5/19
to jenkinsc...@googlegroups.com
jerry wiltse updated an issue
Change By: jerry wiltse
We have this utility function in our Jenkins Shared Library:
{code:java}

static List<String> convertMapToJenkinsEnv(Map<String,String> srcEnv) {
    return srcEnv.collect { "${it.key}=${it.value}"}
}{code}

It seems obvious that this could be an alternative signature
and implementation to the current basic built-in function:

{code:java}
withEnv
{code}


For us, it's far more ergonomic to work with and compose maps in our Shared Library and scripted pipelines, taking advantage of it's well-defined characteristics surrounding unique keys etc.  

It seems as trivial as it could be to implement this.

Reply all
Reply to author
Forward
0 new messages