This article helps you to download the artifacts which are part of a build that is pushed to the Artifactory.
In order to download the artifacts present in a build, we use the Artifactory REST API to download all the artifacts in an archive format from the API call.
For example,
I have buildinfo.json as below which are filled with mandatory parameters.
{
"buildName": "test-art-publish",
"buildNumber": "20",
"archiveType": "tar"
}
The archiveType supported are tar/zip/tar.gz/tgz.
The below screenshot shows the build artifacts that we want to download from Artifactory build.
And the command to download the build artifacts is as below.
$ curl https://test.jfrog.io/artifactory/api/archive/buildArtifacts -XPOST -H "Content-Type: application/json" -T buildinfo.json -vvv --output test.tar
$ ls -ltr test.tar
-rw-r--r-- 1 amithkm staff 5120 Jul 5 11:43 test.tar
After downloading the test.tar file using the above REST API, the contents in the tar file are as below.
$ tar -xvf test.tar
x InnerArtifactoryPipelineNoFlat.zip
x ArtifactoryPipelineNoProps.zip
x InnerArtifactoryPipeline.zip
x ArtifactoryPipeline.zip