Get build steps using Jenkins Pipeline REST API
Asked Answered
M

1

6

I would like to ask is there any way to query run time build steps by using Jenkins pipeline REST API? I refer to this link https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api and it seems like I can't get a run time build steps command line that I configure for Jenkins pipeline job.

Any suggestions?

Multinuclear answered 27/6, 2018 at 9:18 Comment(1)
Using pipeline-stage-view-plugin API /job/myJob/2/execution/node/54/wfapi/describe I see JSON results like "name": "Shell Script", "parameterDescription": "git clean -xfd", which corresponds to my Jenkinsfile: sh "git clean -xfd". Can you expand what information you can't get?Tc
I
0

It seems there is no possibility to get this information via the REST API. I found a solution somewhere. With

http://Serverurl/job/jobname/config.xml

you can download the config file and parse the XML. Doing it with PowerShell and it's working fine.

Inglenook answered 1/12, 2020 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.