Skip to content

Commit

Permalink
[FIXED JENKINS-15370] env variable not propagated for multiple job ex…
Browse files Browse the repository at this point in the history
…ecutions
  • Loading branch information
imod committed Dec 9, 2012
1 parent 1d5e2cc commit e35607a
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit e35607a

Please sign in to comment.