Skip to content
Permalink
Browse files

[FIXED JENKINS-15370] env variable not propagated for multiple job ex…

…ecutions
  • Loading branch information...
imod committed Dec 9, 2012
1 parent 1d5e2cc commit e35607a3b3c15023eb2b7306e15f7ed211139e4b
@@ -83,15 +83,17 @@ public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener l
private void triggerAllBuildsConcurrent(AbstractBuild build, BuildListener listener) {

final List<String> newBuildNodes = new ArrayList<String>();
String parmaName = null;

final ParametersAction origParamsAction = build.getAction(ParametersAction.class);
final List<ParameterValue> origParams = origParamsAction.getParameters();
final List<ParameterValue> newPrams = new ArrayList<ParameterValue>();
for (ParameterValue parameterValue : origParams) {
if (parameterValue instanceof LabelParameterValue) {
if (parameterValue instanceof NodeParameterValue) {
NodeParameterValue origNodePram = (NodeParameterValue) parameterValue;
List<String> nextNodes = origNodePram.getNextLabels();
NodeParameterValue origNodeParam = (NodeParameterValue) parameterValue;
parmaName = origNodeParam.getName();
List<String> nextNodes = origNodeParam.getNextLabels();
if (nextNodes != null) {
listener.getLogger().print("next nodes: " + nextNodes);
newBuildNodes.addAll(nextNodes);
@@ -104,7 +106,7 @@ private void triggerAllBuildsConcurrent(AbstractBuild build, BuildListener liste
for (String nodeName : newBuildNodes) {
final List<String> singleNodeList = new ArrayList<String>();
singleNodeList.add(nodeName);
final NodeParameterValue nodeParameterValue = new NodeParameterValue(nodeName, singleNodeList);
final NodeParameterValue nodeParameterValue = new NodeParameterValue(parmaName, singleNodeList);
List<ParameterValue> copies = new ArrayList<ParameterValue>(newPrams);
copies.add(nodeParameterValue); // where to do the next build
listener.getLogger().print("schedule build on node " + nodeName);

0 comments on commit e35607a

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