From 4dccf2d98e728800024002921c899faca7909245 Mon Sep 17 00:00:00 2001 From: Nikita Gryzlov Date: Wed, 15 Apr 2020 18:23:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=BE=D1=81=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=B3=D0=B3=D0=B5=D1=80=D0=B0=20=D0=B2=20=D0=BE=D1=82=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ru/pulsar/jenkins/library/steps/Logger.groovy | 13 +++++++++++++ vars/printLocation.groovy | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/ru/pulsar/jenkins/library/steps/Logger.groovy diff --git a/src/ru/pulsar/jenkins/library/steps/Logger.groovy b/src/ru/pulsar/jenkins/library/steps/Logger.groovy new file mode 100644 index 0000000..1692335 --- /dev/null +++ b/src/ru/pulsar/jenkins/library/steps/Logger.groovy @@ -0,0 +1,13 @@ +package ru.pulsar.jenkins.library.steps + +import ru.pulsar.jenkins.library.IStepExecutor +import ru.pulsar.jenkins.library.ioc.ContextRegistry + +class Logger implements Serializable { + static void printLocation() { + IStepExecutor steps = ContextRegistry.getContext().getStepExecutor() + + def env = System.getenv(); + steps.echo("Running on node $env.NODE_NAME") + } +} diff --git a/vars/printLocation.groovy b/vars/printLocation.groovy index 00d3344..c408e98 100644 --- a/vars/printLocation.groovy +++ b/vars/printLocation.groovy @@ -1,3 +1,5 @@ +import ru.pulsar.jenkins.library.steps.Logger + def call() { - echo "Running on node $env.NODE_NAME" + Logger.printLocation() }