您可以使用Jenkins REST API获取节点:job / test / 1 / api / json?depth = 2
结果应包含以下内容:
{"_class":"org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode","actions":[{},{},{}],"displayName":"Branch: 0","iconColor":"blue","id":"13","parents":["3"],"running":false,"url":"job/test/1/execution/node/13/"},{"_class":"org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode","actions":[{},{},{}],"displayName":"Allocate node : Start","iconColor":"blue","id":"23","parents":["13"],"running":false,"url":"job/test/1/execution/node/23/"},{"_class":"org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode","actions":[{},{}],"displayName":"Allocate node : Body : Start","iconColor":"blue","id":"33","parents":["23"],"running":false,"url":"job/test/1/execution/node/33/"},{"_class":"org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode","actions":[{},{}],"displayName":"Print Message","iconColor":"blue","id":"37","parents":["33"],"running":false,"url":"job/test/1/execution/node/37/"}因此,对于您的情况,您对分支名称为StepAtomNode的子级(给定名称为0-9)感兴趣。从中,您可以通过简单地将日志添加到控制台输出地址来获得控制台输出地址(例如:job
/ test / 1 / execution / node / 37 / log)。
现在,这里变得有些丑陋,您需要解析html才能从
<pre >log here</pre>



