Navigation Menu

Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Florence.Chabanois authored and gboissinot committed Jan 26, 2012
1 parent d18ba07 commit 72951ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 158 deletions.
Expand Up @@ -54,14 +54,18 @@ public Environment setUpEnvironment(AbstractBuild build, Launcher launcher, Buil
infraEnvVarsMaster.putAll(getJenkinsSystemVariablesMaster(build));
}

//Add build variables (such as parameter variables).
//Add build variables
if (envInjectJobProperty.isKeepBuildVariables()) {
logger.info("Jenkins build variables are kept.");
Map<String, String> buildVariables = variableGetter.getBuildVariables(build, logger);
infraEnvVarsNode.putAll(buildVariables);
infraEnvVarsMaster.putAll(buildVariables);
}

//Add build parameters (or override)
Map<String, String> parametersVariables = variableGetter.getParametersVariables(build);
infraEnvVarsNode.putAll(parametersVariables);

final FilePath rootPath = getNodeRootPath();
if (rootPath != null) {

Expand Down Expand Up @@ -185,12 +189,28 @@ private FilePath getNodeRootPath() {
return null;
}


private boolean parameter2exclude(EnvironmentContributingAction a) {

if ((EnvInjectBuilder.ENVINJECT_BUILDER_ACTION_NAME).equals(a.getDisplayName())) {
return true;
}

if (a instanceof ParametersAction) {
return true;
}

return false;
}

@Override
public void onCompleted(Run run, TaskListener listener) {
EnvInjectLogger logger = new EnvInjectLogger(listener);

//Add other plugins env vars contribution variables (exclude builder action and parameter actions already populated)
EnvVars envVars = new EnvVars();
for (EnvironmentContributingAction a : Util.filter(run.getActions(), EnvironmentContributingAction.class)) {
if (!(EnvInjectBuilder.ENVINJECT_BUILDER_ACTION_NAME).equals(a.getDisplayName())) {
if (!parameter2exclude(a)) {
a.buildEnvVars((AbstractBuild<?, ?>) run, envVars);
}
}
Expand Down

This file was deleted.

0 comments on commit 72951ad

Please sign in to comment.