Jenkins – Can a Jenkins build access the archived artifacts from itself

Jenkins

I'm using Jenkins and have the "Archive the Artifacts" step at the end of my builds to archive them into a zip file.

Instead of using this step, I'd like to use a script to push the artifacts to a remote server at the end of the build. The server I'm pushing to uses a REST API / HTTP PUT request in a script to upload files.

Note that I'm looking to access the artifact created in the same build. So if I'm on build #5, I want the artifacts from build #5, not build #4.

Is there any way to access this zip file with a script, in the same build that it was created in?

I need to upload this zip remotely and don't want to create another job to do so.

Best Answer

You can install one of the "Publish Over..." plugins to upload your artifacts at the end of a build.

The goal of the Publish Over plugins is to provide a consistent set of features and behaviours when sending build artifacts ... somewhere.

See also the full list of "upload" plugins for other methods of publishing your artifacts.