1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2025-01-09 14:45:27 +02:00

Вынос логгера в отдельный класс

This commit is contained in:
Nikita Gryzlov 2020-04-15 18:23:18 +03:00
parent 6e0c5885ae
commit 4dccf2d98e
No known key found for this signature in database
GPG Key ID: C1EAE411FEF0BF2F
2 changed files with 16 additions and 1 deletions

View File

@ -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")
}
}

View File

@ -1,3 +1,5 @@
import ru.pulsar.jenkins.library.steps.Logger
def call() {
echo "Running on node $env.NODE_NAME"
Logger.printLocation()
}