是否有任何 Jenkins API 来获取工件名称并下载它? [英] Is there any Jenkins API to get artifacts name and download it?
问题描述
我想问一下,如果我使用 jenkins.如何获取所有工件列表并下载它,但不能从 jenkins Web 界面下载.我想为某些目标制作自己的网络界面.
是否有任何 jenkins API 可以做到这一点?
根据这个回答:
接下来,您可以构建下载 URL,例如:http://your.jenkins.server/job/your.job/lastStableBuild/artifact/relativePath
I want to ask, If I use jenkins. How can I get all artifacts list and download it, but not from jenkins web interface. I want to make my own web interface for certain goals.
Is there any jenkins API to do this?
According to this answer: https://superuser.com/questions/587426/download-a-file-from-the-latest-stable-jenkins-build
You can use the Jenkins API to get the list of artifacts: http://your.jenkins.server/job/your.job/lastStableBuild/api/xml?tree=artifacts%5BrelativePath%5D
With a script, you can extract the artefact relative path:
Next, you can build your download URLs like: http://your.jenkins.server/job/your.job/lastStableBuild/artifact/relativePath
这篇关于是否有任何 Jenkins API 来获取工件名称并下载它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!