Hi All -
I'm looking to find means of obtaining job (console) logs from build steps
in a workflow. Any help is greatly appreciated!
In the workflow script below, I am creating a *map* that contains that
contains a build-step of 'TestJenkinsJob'. After the job is completed, I
check the results for a failure. Is there way to access the job's logs?
I see that the RunWrapper does not expose any api to retrieve
Run.getLogFile().
Many Thanks!
-Vizionz
// Allocate Node
//////////
node("MyNode")
{
// Set Directory
//////////
dir("PathToDirectory")
{
// Map of builds for parallel execution
/////////
def buildMap = [:]
// Setup JOB_1
/////////
buildMap["JOB_1"] = {
// Start a test job.
/////////
def jobInfo = build job: 'TestJenkinsJob', propagate: false
if (jobInfo.getResult() == "FAILURE")
{
// Access logfile of job - NOT EXPOSED in RunWrapper
//////////
def failLog = jobInfo.getLogFile()
println "FAIL_LOG\n$failLog"
// ... Do more work with fail log (save/parse/report/etc.)
}
}
// Setup JOB_2
//////////
buildMap["JOB_2"] = {
// ... Setup Job 2
}
// Start the parallel job
/////////
parallel buildMap
}
}
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/1b15af84-4ec4-415f-8c1d-7391fb4daec8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.