@Overridepublic void onCompleted(Run<?, ?> run, TaskListener listener) {Node node = run.getExecutor().getOwner().getNode();String nodeName = node.getNodeName();EnvVars environment = run.getEnvironment(listener);if (nodeName.equals("") && environment.containsKey("NODE_NAME")) {nodeName = environment.get("NODE_NAME");}}
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c17fd3d7-86a6-4622-8f34-1a6c95feac05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In pipeline, the information is added to ENV_VARS only for the time that the pipeline really is using an executor on a node. So you will not be able to collect this information in the onCompleted method of a RunListener. Also consider that a pipeline can run on multiple nodes.
You might consider implementing an ExecutorListener.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3M5E1Uw7N5Boq_B1-0mHcAR0E0BZMUCKw7zpp_%2B1n4ng%40mail.gmail.com.