summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@openstack.org>2013-08-13 17:29:09 -0700
committerJames E. Blair <jeblair@openstack.org>2013-08-13 17:29:29 -0700
commit36ca349ad10c3f17e69a70c73fefcb2ae3405ca7 (patch)
tree32f894a4b8f71e498bf44d9070f359fe09e358ca
parent41e07786b0b973f6ccebee86584bec7419de21ec (diff)
Include the node name0.0.2
Notes
Notes (review): Verified+2: Jenkins Approved+1: Clark Boylan <clark.boylan@gmail.com> Code-Review+2: Clark Boylan <clark.boylan@gmail.com> Submitted-by: Jenkins Submitted-at: Wed, 14 Aug 2013 01:37:19 +0000 Reviewed-on: https://review.openstack.org/41814 Project: openstack-infra/zmq-event-publisher Branch: refs/heads/master
-rw-r--r--src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java10
-rw-r--r--src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java
index 6518e5e..bddf36e 100644
--- a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java
+++ b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java
@@ -23,6 +23,8 @@ import hudson.model.Job;
23import hudson.model.ParameterValue; 23import hudson.model.ParameterValue;
24import hudson.model.ParametersAction; 24import hudson.model.ParametersAction;
25import hudson.model.Run; 25import hudson.model.Run;
26import hudson.model.Executor;
27import hudson.model.Computer;
26import hudson.model.TaskListener; 28import hudson.model.TaskListener;
27 29
28import java.io.IOException; 30import java.io.IOException;
@@ -71,6 +73,14 @@ public enum Phase {
71 buildState.setFullUrl(rootUrl + run.getUrl()); 73 buildState.setFullUrl(rootUrl + run.getUrl());
72 } 74 }
73 75
76 Executor executor = run.getExecutor();
77 if (executor != null) {
78 Computer computer = executor.getOwner();
79 if (computer != null) {
80 buildState.setNodeName(computer.getName());
81 }
82 }
83
74 jobState.setBuild(buildState); 84 jobState.setBuild(buildState);
75 85
76 ParametersAction paramsAction = run.getAction(ParametersAction.class); 86 ParametersAction paramsAction = run.getAction(ParametersAction.class);
diff --git a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java
index f2a689f..68ca339 100644
--- a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java
+++ b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java
@@ -34,6 +34,8 @@ public class BuildState {
34 34
35 private Map<String, String> parameters; 35 private Map<String, String> parameters;
36 36
37 private String nodeName;
38
37 public int getNumber() { 39 public int getNumber() {
38 return number; 40 return number;
39 } 41 }
@@ -81,4 +83,12 @@ public class BuildState {
81 public void setParameters(Map<String, String> params) { 83 public void setParameters(Map<String, String> params) {
82 this.parameters = params; 84 this.parameters = params;
83 } 85 }
86
87 public String getNodeName() {
88 return nodeName;
89 }
90
91 public void setNodeName(String nodeName) {
92 this.nodeName = nodeName;
93 }
84} 94}