Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix JENKINS-14437 (Add a way to override build parameters)
- Loading branch information
1 parent
bf62a85
commit ed245ce
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildVariableContributor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.jenkinsci.plugins.envinject; | ||
|
||
import hudson.Extension; | ||
import hudson.model.AbstractBuild; | ||
import hudson.model.BuildVariableContributor; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author Gregory Boissinot | ||
*/ | ||
@Extension | ||
public class EnvInjectBuildVariableContributor extends BuildVariableContributor { | ||
|
||
@Override | ||
public void buildVariablesFor(AbstractBuild build, Map<String, String> variables) { | ||
EnvInjectPluginAction envInjectAction = build.getAction(EnvInjectPluginAction.class); | ||
if (envInjectAction != null) { | ||
variables.putAll(envInjectAction.getEnvMap()); | ||
} | ||
} | ||
} |