Reputation: 145
I am trying to generate a link for a user to download a build artifact (WAR for maven and ZIP for SBT) from Jenkins after a successful build. I could not figure it out but I found that I have to write a small ant script which can generate an url to download an artifact.
Upvotes: 0
Views: 4605
Reputation: 687
You can download directly from workspace
http://<Jenkins URL>:<Jenkins>/job/Test/ws/<location of artifact>/xyz.zip
or from Last stable build
http://<URL>:<PORT>/job/Test/lastSuccessfulBuild/artifact/xzy.zip
or from Last build
http://<Jenkins URL>:<Jenkins>/job/Test/lastBuild/artifact/xzy.zip
If there is authentication
curl -X POST --user usernme:API_Token http://<Jenkins URL>:<Jenkins>/job/Test/lastSuccessfulBuild/artifact/xzy.zip -o xzy.zip
All these links are permanent and will not change
Upvotes: 2