Include the node name
Change-Id: I1cf2aee446c1e51c8eb15f7d84c3e828f3716cce
This commit is contained in:
parent
41e07786b0
commit
36ca349ad1
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue