Problem
When you do CI with JFrog Artifactory when you want to download the entire folder artifacts, but maybe your IT doesn’t enable this function, whatever some seasons.
You can try the below JFrog Artifactory API to know if you’re using Artifactory whether allowed to download the entire folder artifacts.
just visit this API URL: https://den-artifactory.company.com/artifactory/api/archive/download/team-generic-release-den/project/abc/main/?archiveType=zip
You will see an error message returned if the Artifactory is not allowed to download the entire folder.
{ |
More details about the API could find here Retrieve Folder or Repository Archive
Workaround
So to be enabled to download entire folder artifacts, I found other JFrog Artifactory APIs provide a workaround.
How to download the entire folder artifacts programmatically? this post will show you how to use other Artifactory REST API to get a workaround.
1. Get All Artifacts Created in Date Range
API URL: Artifacts Created in Date Range
This is the snippet code I use this API
# download.sh |
Then you just use this as: sh download.sh ${USERNAME} ${PASSWORD} ${REPO_PATH} ${N_DAY_AGO}
2. Get all artifacts matching the given Ant path pattern
More about this API see: Pattern Search
Take an example screenshot of pattern search:
Then you can use Shell, Python language to get the file path from the response, then use curl -u $USERNAME:$PASSWORD -O $PATH_TO_FILE
command to download the file one by one.
If you have better solutions, suggestions, or questions, you can leave a comment.