ARTIFACTORY: How to download build artifacts from Artifactory builds

ARTIFACTORY: How to download build artifacts from Artifactory builds

AuthorFullName__c
Amith Kumar Mutakari
articleNumber
000005327
ft:sourceType
Salesforce
FirstPublishedDate
2022-07-06T11:05:12Z
lastModifiedDate
2022-07-06
VersionNumber
3

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.

User-added image

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