简体   繁体   English

如何使用带有Curl命令的jFrog下载最新上传的文件?

[英]How to download the latest uploaded file using jFrog with Curl command?

I have set of files uploaded to the global repository. 我已将一组文件上传到全局存储库。 I need to download the latest uploaded file.. How can I do it by using jFrog? 我需要下载最新上传的文件。如何使用jFrog完成它? Which Curl command should I use? 我应该使用哪个Curl命令?

Currently I am using curl -O https://***/artifactory/snapshots/***/***/***/***-SNAPSHOT/test.xml which downloads the file on the server, but this is useful when there is a specific name, but, I want to download the latest one. 当前,我正在使用curl -O https://***/artifactory/snapshots/***/***/***/***-SNAPSHOT/test.xml ,它将文件下载到服务器上,但这有特定名称时很有用,但是,我想下载最新名称。

You can use Artifactory's AQL to apply your search/delete filters. 您可以使用Artifactory的AQL来应用搜索/删除过滤器。

specifically, in your example you can use SORT and LIMIT to retrieve your latest artifact 具体来说,在您的示例中,您可以使用SORT和LIMIT来检索最新的工件

items.find ({
        "repo":"my-global-repo"
}).sort({"$desc" : ["created"]}).limit(1)

AQL can be use in REST as well as with JFrog's CLI. AQL可以在REST以及JFrog的CLI中使用。 You can find more AQL examples here . 您可以在此处找到更多AQL示例。

I would also recommend trying out the Jfrog CLI, which also supports Sorting and Limiting without the need to use AQL, and might be easier to use. 我还建议您试用Jfrog CLI,它也支持排序和限制,而无需使用AQL,并且可能更易于使用。 You can find CLI examples here 您可以在此处找到CLI示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM