Browse Source

Add node description to event data

There may be interesting information in the node description.  With
Ia4fc671ecb60581be258346afc23125749ba8f15 we are adding nodepool
metadata to the description field.

Change-Id: I95f87d60959e428d888e77de48e9acca0e34b233
James E. Blair 3 years ago
parent
commit
3ef6c4a112

+ 5
- 0
src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java View File

@@ -24,6 +24,7 @@ import hudson.model.ParametersAction;
24 24
 import hudson.model.Run;
25 25
 import hudson.model.Executor;
26 26
 import hudson.model.Computer;
27
+import hudson.model.Node;
27 28
 import hudson.model.TaskListener;
28 29
 import jenkins.model.Jenkins;
29 30
 
@@ -79,6 +80,10 @@ public enum Phase {
79 80
             Computer computer = executor.getOwner();
80 81
             if (computer != null) {
81 82
                 buildState.setNodeName(computer.getName());
83
+                Node node = computer.getNode();
84
+                if (node != null) {
85
+                    buildState.setNodeDescription(node.getNodeDescription());
86
+                }
82 87
             }
83 88
         }
84 89
 

+ 10
- 0
src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java View File

@@ -36,6 +36,8 @@ public class BuildState {
36 36
 
37 37
     private String nodeName;
38 38
 
39
+    private String nodeDescription;
40
+
39 41
     private String hostName;
40 42
 
41 43
     public int getNumber() {
@@ -94,6 +96,14 @@ public class BuildState {
94 96
         this.nodeName = nodeName;
95 97
     }
96 98
 
99
+    public String getNodeDescription() {
100
+        return nodeDescription;
101
+    }
102
+
103
+    public void setNodeDescription(String nodeDescription) {
104
+        this.nodeDescription = nodeDescription;
105
+    }
106
+
97 107
     public String getHostName() {
98 108
         return hostName;
99 109
     }

Loading…
Cancel
Save