mirror of
https://github.com/elastic/kibana.git
synced 2025-04-20 16:03:20 -04:00
21 lines
728 B
Groovy
21 lines
728 B
Groovy
def getSteps() {
|
|
def url = "${env.BUILD_URL}api/json?tree=actions[nodes[iconColor,running,displayName,id,parents]]"
|
|
def responseRaw = httpRequest([ method: "GET", url: url ])
|
|
def response = toJSON(responseRaw)
|
|
|
|
def graphAction = response?.actions?.find { it._class == "org.jenkinsci.plugins.workflow.job.views.FlowGraphAction" }
|
|
|
|
return graphAction?.nodes
|
|
}
|
|
|
|
def getFailedSteps() {
|
|
def steps = getSteps()
|
|
def failedSteps = steps?.findAll { (it.iconColor == "red" || it.iconColor == "red_anime") && it._class == "org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode" }
|
|
failedSteps.each { step ->
|
|
step.logs = "${env.BUILD_URL}execution/node/${step.id}/log".toString()
|
|
}
|
|
|
|
return failedSteps
|
|
}
|
|
|
|
return this
|