从Artifactory下载工件档案 [英] Download artifacts archive from Artifactory

查看:113
本文介绍了从Artifactory下载工件档案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试Artifactory 4.2.0 PRO.

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

但是,当使用AQL指定确切属性时,我找不到是否可以做同样的事情(下载存档).我一直在尝试上传其他属性与构建推送的属性完全相同的工件,但是上面的代码片段并未提取它们(我假设某种元数据存储在某处).

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).

在不使用许多HTTP查询的情况下获取多个工件的可能性是什么?

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

关于.

推荐答案

检索文件夹或存储库归档API 允许下载包含位于指定路径(文件夹或存储库根目录)下的所有工件的归档文件(支持zip/tar/tar.gz/tgz).但是,它不支持按属性过滤.

Artifactory CLI 支持同时下载多个文件.它还支持下载与一组属性值匹配的文件.但是,CLI将使用多个HTTP请求.

第三种选择是开发自定义用户插件,该插件可以下载档案与一组属性匹配的工件.执行用户插件可以执行为REST API调用. JFrogDev GitHub帐户中有一个示例插件.可以作为一个很好的起点.该插件允许下载目录的内容作为存档.

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.

这篇关于从Artifactory下载工件档案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆