简体   繁体   中英

How to view Jenkins job configuration as XML in the Browser

Having access to a Jenkins job configuration via the UI, how can I view the configuration as XML in the browser?

One can view a Jenkins job configuration as XML in the browser by appending config.xml to the end of the URL. For example, if you have the following URL to a Jenkins job https://jenkins.mycompany.com/job/myjob , append config.xml : https://jenkins.mycompany.com/job/myjob/config.xml . This also works for users who do not have write access to the job.

This solution was tested with Jenkins 2.138.

Credit for this answer goes to Terraform user taiidani , who mentioned this in the Jenkins provider documentation: https://registry.terraform.io/providers/taiidani/jenkins/latest/docs/resources/job#template

Use the cli much more efficient and faster!

> java -jar jenkins-cli.jar -s http://jenkinsserver get-job nameofJob >
> myjob.xml

Then simply view myjob.xml in browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM