如何使用curl脚本解析AQL下载神器?
How to download the artifactory by parsing AQL using curl script?
我正在使用 curl 从存储库下载最新的工件,然后想将它下载到我的服务器。我该如何实现。我正在使用以下命令获取 AQL。
curl -u 'uname:pwd' -X PUT
https://testrepo.test.test/artifactory/api/search/aql -d 'items.find
({"repo":"snapshots"},{"name":{"$match":"test*.war"}}).sort({"$desc" :
["created"]}).limit(3)' -H "Content-Type: text/plain"
以下是我得到的AQL -
{ "results" : [ { "repo" : "snapshots", "path" :
"******-SNAPSHOT", "name" : "*****.war", "type" : "file", "size"
: 63059101, "created" : "2018-05-31T08:39:11.353-05:00",
"created_by" : "***_user", "modified" :
"2018-05-31T08:39:09.724-05:00", "modified_by" : "****_user",
"updated" : "2018-05-31T08:39:09.724-05:00" } ], "range" : {
"start_pos" : 0, "end_pos" : 1, "total" : 1, "limit" : 3 } }
如何使用 Curl 解析此 AQL 来下载工件?
您可以使用JFrog CLI,这是JFrog的免费CLI工具。
通过这样做,您可以 "ask" CLI 到 download the artifact/s 基于 AQL 搜索,这意味着您所要做的就是指定相同的 AQL 查询,CLI 将为您解决它。
我正在使用 curl 从存储库下载最新的工件,然后想将它下载到我的服务器。我该如何实现。我正在使用以下命令获取 AQL。
curl -u 'uname:pwd' -X PUT https://testrepo.test.test/artifactory/api/search/aql -d 'items.find ({"repo":"snapshots"},{"name":{"$match":"test*.war"}}).sort({"$desc" : ["created"]}).limit(3)' -H "Content-Type: text/plain"
以下是我得到的AQL -
{ "results" : [ { "repo" : "snapshots", "path" : "******-SNAPSHOT", "name" : "*****.war", "type" : "file", "size" : 63059101, "created" : "2018-05-31T08:39:11.353-05:00",
"created_by" : "***_user", "modified" : "2018-05-31T08:39:09.724-05:00", "modified_by" : "****_user",
"updated" : "2018-05-31T08:39:09.724-05:00" } ], "range" : {
"start_pos" : 0, "end_pos" : 1, "total" : 1, "limit" : 3 } }
如何使用 Curl 解析此 AQL 来下载工件?
您可以使用JFrog CLI,这是JFrog的免费CLI工具。 通过这样做,您可以 "ask" CLI 到 download the artifact/s 基于 AQL 搜索,这意味着您所要做的就是指定相同的 AQL 查询,CLI 将为您解决它。