Download artifacts archive from Artifactory

泄露秘密 提交于 2019-12-07 22:34:29

问题


I'm testing Artifactory 4.2.0 PRO.

The really nice feature is the possibility to download an archive of all files produced by the build by executing, something like:

curl -XPOST -u admin:password -H "Content-Type: application/json"  http://localhost:8081/artifactory/api/archive/buildArtifacts -d '
{
      "buildName": "Vehicle Routing Problem", 
      "buildNumber": "3", 
      "archiveType": "zip"
}' > build.zip

However, I'm unable to find if there is a possibility to do the same (download archive) when specifying exact properties using AQL. I have been trying to upload other artifacts with properties exactly the same as those pushed by the build, but they were not fetch by the snippet above (I assume some sort of metadata is stored somewhere).

What are the possibilities to fetch multiple artifacts without using many HTTP queries?

Regards.


回答1:


The Retrieve Folder or Repository Archive API allows to download an archive file (supports zip/tar/tar.gz/tgz) containing all the artifacts that reside under the specified path (folder or repository root). However it does not support filtering by properties.

The Artifactory CLI supports concurrently downloading multiple files. It also supports downloading files we matches a set of property values. The CLI, however, will use multiple HTTP requests for doing so.

A third option would be developing a custom user plugin which allows downloading an archive of artifacts matching a set of properties. An execution user plugin can be executed as a REST API call. There is a sample plugin in the JFrogDev GitHub account which can serve as a good start point. This plugin allows downloading the content of a directory as an archive.



来源:https://stackoverflow.com/questions/33540960/download-artifacts-archive-from-artifactory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!