Get Jenkins artifacts URl from REST api
12,962
Solution 1
you mean this?
http://jenkins/job/myjob/../api/json?tree=artifacts[*]
Reference: Click here
Solution 2
If you're using the ArtifactDeployer Plugin, then, unfortunately, the artifacts deployed through it won't be listed by the API.
The ideal solution, if you have the time for it, would be to mod the plugin and add an API to it.
In my case, due to time constraints, I had to scrape the page instead, by fetching the build's HTML page and picking up all the <a>
tags whose href
started with "deployedartifact/downloads".
Related videos on Youtube
Comments
-
New Developer almost 2 years
Is there any way to get artifacts download url from jenkins REST API. I am using
artifact deployer
and artifacts can be download fromhttp://localhost:8080/job/jobname/buildId/deployedartifact/downloads/artifacts.{id}
Is it possible to get the url infomation from REST api??
-
Mark Rotteveel almost 10 yearspossible duplicate of Jenkins REST API - using tree to reference specific item in JSON array
-
Haroldo_OK over 8 yearsNot really; from the URL, he seems to be using some remote deployment plugin, in which case the deployed artifacts won't be listed as artifacts by the API.
-
-
Haroldo_OK over 8 yearsNot really; from the URL, he seems to be using some remote deployment plugin, in which case the deployed artifacts won't be listed as artifacts by the API.