Skip to content
Permalink
Browse files

fix JENKINS-30906

  • Loading branch information
Chen Cohen
Chen Cohen committed Nov 12, 2015
1 parent 1382428 commit 67e0633fad2789a1c4dc89cd76beef6166addf68
@@ -1,17 +1,5 @@
package com.tikal.jenkins.plugins.multijob;

import hudson.model.Action;
import hudson.model.Build;
import hudson.model.BuildListener;
import hudson.model.ParameterValue;
import hudson.model.Result;
import hudson.model.AbstractProject;
import hudson.model.ParametersAction;
import hudson.model.Run;
import hudson.model.StringParameterValue;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;

import java.io.File;
import java.io.IOException;
import java.util.Collections;
@@ -22,13 +10,25 @@

import javax.servlet.ServletException;

import jenkins.model.Jenkins;

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.Build;
import hudson.model.BuildListener;
import hudson.model.ParameterValue;
import hudson.model.ParametersAction;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.StringParameterValue;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import jenkins.model.Jenkins;

@ExportedBean(defaultVisibility = 999)
public class MultiJobBuild extends Build<MultiJobProject, MultiJobBuild> {

@@ -188,10 +188,12 @@ private boolean evaluateResult(Result result) {
private final String url;
private final boolean retry;
private final boolean aborted;
private final AbstractBuild<?, ?> build;

public SubBuild(String parentJobName, int parentBuildNumber,
String jobName, int buildNumber, String phaseName,
Result result, String icon, String duration, String url) {
Result result, String icon, String duration, String url,
AbstractBuild<?, ?> build) {
this.parentJobName = parentJobName;
this.parentBuildNumber = parentBuildNumber;
this.jobName = jobName;
@@ -203,12 +205,13 @@ public SubBuild(String parentJobName, int parentBuildNumber,
this.url = url;
this.retry = false;
this.aborted = false;
this.build = build;
}

public SubBuild(String parentJobName, int parentBuildNumber,
String jobName, int buildNumber, String phaseName,
Result result, String icon, String duration, String url,
boolean retry, boolean aborted) {
boolean retry, boolean aborted, AbstractBuild<?, ?> build) {
this.parentJobName = parentJobName;
this.parentBuildNumber = parentBuildNumber;
this.jobName = jobName;
@@ -220,6 +223,7 @@ public SubBuild(String parentJobName, int parentBuildNumber,
this.url = url;
this.retry = retry;
this.aborted = aborted;
this.build = build;
}

@Exported
@@ -267,7 +271,7 @@ public int getParentBuildNumber() {
public String getJobName() {
return jobName;
}

@Exported
public int getBuildNumber() {
return buildNumber;
@@ -284,5 +288,10 @@ public String toString() {
+ ", parentBuildNumber=" + parentBuildNumber + ", jobName="
+ jobName + ", buildNumber=" + buildNumber + "]";
}

@Exported
public AbstractBuild<?,?> getBuild() {
return build;
}
}
}
@@ -637,44 +637,44 @@ private void updateSubBuild(MultiJobBuild multiJobBuild,
MultiJobProject multiJobProject, PhaseJobsConfig phaseConfig) {
SubBuild subBuild = new SubBuild(multiJobProject.getName(),
multiJobBuild.getNumber(), phaseConfig.getJobName(), 0,
phaseName, null, BallColor.NOTBUILT.getImage(), "not built", "");
phaseName, null, BallColor.NOTBUILT.getImage(), "not built", "", null);
multiJobBuild.addSubBuild(subBuild);
}

private void updateSubBuild(MultiJobBuild multiJobBuild,
MultiJobProject multiJobProject, AbstractBuild jobBuild) {
MultiJobProject multiJobProject, AbstractBuild<?, ?> jobBuild) {
SubBuild subBuild = new SubBuild(multiJobProject.getName(),
multiJobBuild.getNumber(), jobBuild.getProject().getName(),
jobBuild.getNumber(), phaseName, null, jobBuild.getIconColor()
.getImage(), jobBuild.getDurationString(),
jobBuild.getUrl());
jobBuild.getUrl(), jobBuild);
multiJobBuild.addSubBuild(subBuild);
}

private void updateSubBuild(MultiJobBuild multiJobBuild,
MultiJobProject multiJobProject, AbstractBuild jobBuild,
MultiJobProject multiJobProject, AbstractBuild<?, ?> jobBuild,
Result result) {
SubBuild subBuild = new SubBuild(multiJobProject.getName(),
multiJobBuild.getNumber(), jobBuild.getProject().getName(),
jobBuild.getNumber(), phaseName, result, jobBuild.getIconColor().getImage(),
jobBuild.getDurationString(), jobBuild.getUrl());
jobBuild.getDurationString(), jobBuild.getUrl(), jobBuild);
multiJobBuild.addSubBuild(subBuild);
}

private void updateSubBuild(MultiJobBuild multiJobBuild,
MultiJobProject multiJobProject, AbstractBuild jobBuild,
MultiJobProject multiJobProject, AbstractBuild<?, ?> jobBuild,
Result result, boolean retry) {
SubBuild subBuild = new SubBuild(multiJobProject.getName(),
multiJobBuild.getNumber(), jobBuild.getProject().getName(),
jobBuild.getNumber(), phaseName, result, jobBuild.getIconColor().getImage(),
jobBuild.getDurationString(), jobBuild.getUrl(), retry, false);
jobBuild.getDurationString(), jobBuild.getUrl(), retry, false, jobBuild);
multiJobBuild.addSubBuild(subBuild);
}

private void abortSubBuild(MultiJobBuild multiJobBuild, MultiJobProject multiJobProject, AbstractBuild jobBuild) {
private void abortSubBuild(MultiJobBuild multiJobBuild, MultiJobProject multiJobProject, AbstractBuild<?, ?> jobBuild) {
SubBuild subBuild = new SubBuild(multiJobProject.getName(),
multiJobBuild.getNumber(), jobBuild.getProject().getName(),
jobBuild.getNumber(), phaseName, Result.ABORTED, BallColor.ABORTED.getImage(), "", jobBuild.getUrl(), false, true);
jobBuild.getNumber(), phaseName, Result.ABORTED, BallColor.ABORTED.getImage(), "", jobBuild.getUrl(), false, true, jobBuild);
multiJobBuild.addSubBuild(subBuild);
}

0 comments on commit 67e0633

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