Skip to content
Permalink
Browse files

Fix JENKINS-13183

  • Loading branch information...
gboissinot committed Mar 22, 2012
1 parent 49b75b3 commit 557267f02ea1ef05be9b04880a97984896741255
@@ -7,6 +7,7 @@
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Result;
import hudson.scm.SCM;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrapperDescriptor;
import net.sf.json.JSONObject;
@@ -58,6 +59,12 @@ public Environment setUp(AbstractBuild build, final Launcher launcher, final Bui
injectedEnvVars.put("WORKSPACE", ws.getRemote());
}

//Add SCM variables if not set
SCM scm = build.getProject().getScm();
if (scm != null) {
scm.buildEnvVars(build, injectedEnvVars);
}

//Get result variables
Map<String, String> propertiesEnvVars = envInjectEnvVarsService.getEnvVarsPropertiesProperty(ws, logger, info.getPropertiesFilePath(), info.getPropertiesContentMap(), injectedEnvVars);

@@ -5,6 +5,7 @@
import hudson.FilePath;
import hudson.Launcher;
import hudson.model.*;
import hudson.scm.SCM;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
import org.jenkinsci.lib.envinject.EnvInjectLogger;
@@ -60,6 +61,12 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
variables.put("WORKSPACE", ws.getRemote());
}

//Add SCM variables if not set
SCM scm = build.getProject().getScm();
if (scm != null) {
scm.buildEnvVars(build, variables);
}

//Always keep build variables (such as parameter variables).
variables.putAll(getAndAddBuildVariables(build));

0 comments on commit 557267f

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