Highway of Life
Highway of Life

Reputation: 24301

Access Jenkins build log within build script

How would you go about accessing contents of the build (console) log from within a running build script?

I have a deploy script that runs, logs into a series of servers and runs scripts on those servers. I need to obtain certain output from some of those remote scripts and use them later in the build process and also in the completion email.

Upvotes: 1

Views: 1240

Answers (1)

JamesE
JamesE

Reputation: 3923

You can do something like this in the Post Build section, but I don't think you can do it earlier in the job. With the groovy post build plugin you can get information from the console log:

if(manager.logContains("text to find")) {
    do something
}

Upvotes: 3

Related Questions