Include the node name

Change-Id: I1cf2aee446c1e51c8eb15f7d84c3e828f3716cce
This commit is contained in:
James E. Blair 2013-08-13 17:29:09 -07:00
parent 41e07786b0
commit 36ca349ad1
2 changed files with 20 additions and 0 deletions

View File

@ -23,6 +23,8 @@ import hudson.model.Job;
import hudson.model.ParameterValue;
import hudson.model.ParametersAction;
import hudson.model.Run;
import hudson.model.Executor;
import hudson.model.Computer;
import hudson.model.TaskListener;
import java.io.IOException;
@ -71,6 +73,14 @@ public enum Phase {
buildState.setFullUrl(rootUrl + run.getUrl());
}
Executor executor = run.getExecutor();
if (executor != null) {
Computer computer = executor.getOwner();
if (computer != null) {
buildState.setNodeName(computer.getName());
}
}
jobState.setBuild(buildState);
ParametersAction paramsAction = run.getAction(ParametersAction.class);

View File

@ -34,6 +34,8 @@ public class BuildState {
private Map<String, String> parameters;
private String nodeName;
public int getNumber() {
return number;
}
@ -81,4 +83,12 @@ public class BuildState {
public void setParameters(Map<String, String> params) {
this.parameters = params;
}
public String getNodeName() {
return nodeName;
}
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
}