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

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


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:

enter image description here

Next, you can build your download URLs like:http://your.jenkins.server/job/your.job/lastStableBuild/artifact/relativePath


you can download created artifacts with curl:

curl -u "${USR}":"${PWD}" $JENKINS'/job/'"${NAM}"/"{$JOB}"'/artifact/*zip*/archive.zip' --output "${NAM}_{$JOB}_archive.zip"