From 3ef6c4a112ed1f2bd4bf72884d3db505009e6520 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 4 Apr 2016 09:52:50 -0700 Subject: [PATCH] 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 --- .../org/jenkinsci/plugins/ZMQEventPublisher/Phase.java | 5 +++++ .../plugins/ZMQEventPublisher/model/BuildState.java | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java index e198f0f..fe36f65 100644 --- a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java +++ b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/Phase.java @@ -24,6 +24,7 @@ import hudson.model.ParametersAction; import hudson.model.Run; import hudson.model.Executor; import hudson.model.Computer; +import hudson.model.Node; import hudson.model.TaskListener; import jenkins.model.Jenkins; @@ -79,6 +80,10 @@ public enum Phase { Computer computer = executor.getOwner(); if (computer != null) { buildState.setNodeName(computer.getName()); + Node node = computer.getNode(); + if (node != null) { + buildState.setNodeDescription(node.getNodeDescription()); + } } } 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 4253af0..4413a63 100644 --- a/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java +++ b/src/main/java/org/jenkinsci/plugins/ZMQEventPublisher/model/BuildState.java @@ -36,6 +36,8 @@ public class BuildState { private String nodeName; + private String nodeDescription; + private String hostName; public int getNumber() { @@ -94,6 +96,14 @@ public class BuildState { this.nodeName = nodeName; } + public String getNodeDescription() { + return nodeDescription; + } + + public void setNodeDescription(String nodeDescription) { + this.nodeDescription = nodeDescription; + } + public String getHostName() { return hostName; }