Is there any Jenkins API to get artifacts name and download it? [closed]

大兔子大兔子 提交于 2019-12-04 05:45:13
Bruno Lavit

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

lolo

you can download created artifacts with curl:

curl -u "${USR}":"${PWD}" $JENKINS'/job/'"${NAM}"/"{$JOB}"'/artifact/*zip*/archive.zip' --output "${NAM}_{$JOB}_archive.zip"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!