Jerry
Jerry

Reputation: 145

Generate an URL Of an artifact to download from Jenkins

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

Answers (1)

Pratik Anand
Pratik Anand

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

Related Questions