Skip to content
Permalink
Browse files

Fix JENKINS-16575 and JENKINS-16566

  • Loading branch information
gboissinot committed Feb 3, 2013
1 parent 33013c9 commit 0537bc39eea9fa3fbe318df0a25c45af9810a001
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

@@ -38,7 +39,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<envinject.lib.version>1.14</envinject.lib.version>
<envinject.lib.version>1.15</envinject.lib.version>
<ivy.plugin.version>1.21</ivy.plugin.version>
</properties>

@@ -39,6 +39,9 @@ public void buildVariablesFor(AbstractBuild build, Map<String, String> variables
for (ParameterValue p : parameters) {
String key = p.getName();
Map<String, String> injectedEnvVars = envInjectAction.getEnvMap();
if (injectedEnvVars == null) {
return;
}

//---INPUTS
//GLOBAL envVars, parameters envVars, injectedEnvVars (with global)
@@ -22,6 +22,9 @@ public Object getTarget() {

public void buildEnvVars(AbstractBuild<?, ?> build, EnvVars env) {
EnvInjectVarList varList = (EnvInjectVarList) getTarget();
env.putAll(varList.getEnvMap());
Map<String, String> envMap = varList.getEnvMap();
if (envMap != null) {
env.putAll(envMap);
}
}
}
@@ -22,7 +22,9 @@
private Map<String, String> envVars = new TreeMap<String, String>();

public EnvInjectVarList(Map<String, String> envMap) {
this.envVars.putAll(envMap);
if (envMap != null) {
this.envVars.putAll(envMap);
}
}

@SuppressWarnings("unused")
@@ -89,7 +91,6 @@ private void doExportHeaders(StaplerRequest request, StaplerResponse response) t
}

writeTextResponse(response);
return;
}


@@ -116,7 +117,7 @@ private void writeJsonResponse(StaplerResponse response) throws IOException {
response.setContentType("application/json");
ServletOutputStream outputStream = response.getOutputStream();
outputStream.write("{\"envVars\": { \"envVar\":[".getBytes());
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : envVars.entrySet()) {
sb.append(String.format(", {\"name\":\"%s\", \"value\":\"%s\"}", entry.getKey(), entry.getValue()));
}

0 comments on commit 0537bc3

Please sign in to comment.
You can’t perform that action at this time.