天道酬勤,学无止境

artifactory-query-lang

是否有任何自动方法可以从工件中获取工件下载 URL?(Is there any automated way to get artifact download URL back from artifactory?)

问题 是否有任何自动方法来获取工件下载 URL? 我正在使用 maven 项目,我使用竹子进行构建自动化。 成功构建完成后,工件将被推送到 Jfrog 工件。 我的要求是以自动方式获取工件下载 URL(使用竹插件、Rest API、Jfrog CLI、Maven 或任何其他) 回答1 您可以使用构建工件搜索 REST API 端点。 您需要在 JSON 中发送构建名称 + 编号,Artifactory 将返回构建工件的下载 URI 回答2 我已经将 jenkins 与 artifactory 一起使用,并且每次成功构建都会将 buildinfo.json 发布到 artifactory。 buildinfo json 是一个元数据文件。 您可以通过构建编号。 您将解析 buildinfo json 以获取工件的下载 url。 值得一试,因为您使用的是开源版本。

2021-10-24 00:23:21    分类:技术分享    maven   artifactory   bamboo   jfrog-cli   artifactory-query-lang

如何使用 Artifactory 查询语言找到最新的工件版本?(How to find the latest artifact version with Artifactory Query Language?)

问题 到目前为止,我使用 Artifactory REST API 来确定具有groupId和artifactIid的 maven 工件的最后一个版本(最后一个快照): /api/search/latestVersion?g={groupid}&a={artifactid} 这给了我一个字符串,其中包含此工件的最高/最后可用(快照)版本。 然而,这有时真的很慢,一个建议是使用 Artifactory 查询语言 (AQL)。 不幸的是,我还没有找到如何在 AQL 中映射这个功能。 有人能给我一个关于 AQL 中相应查询是什么样子的线索吗? 提前致谢! 回答1 您可以使用 AQL 的 SORT 和 LIMIT 来检索您的最新工件,例如: items.find( { "repo":"my-repo" } ).sort({"$desc" : ["created"]}).limit(1) 您可以在此处找到更多示例。 我还建议尝试使用 Jfrog CLI,它也支持排序,并且可能更易于使用。

2021-10-20 18:13:22    分类:技术分享    maven   artifactory   jfrog-cli   artifactory-query-lang

Artifactory AQL 获取特定属性(Artifactory AQL Get Specific Properties)

问题 我正在使用 Artifactory 3.5。 我的工件具有自定义属性。 我希望能够查询具有该属性的所有工件,并且我希望结果显示该属性及其值。 我知道我可以使用: items.find(...).include("property.*") 但是,这将返回与查找条件匹配的项目的所有属性。 如何仅显示我想要的特定属性? 回答1 include元素允许您只在结果中包含特定的属性 例如,以下查询结果将仅包含工件名称和“artifactory.licenses”属性: items.find({"@artifactory.licenses" : {"$eq" : "MIT"}}).include("name", "@artifactory.licenses") 这将返回例如: { "results" : [ { "name" : "connection_pool-2.2.0.gem", "properties" : [ { "key" : "artifactory.licenses", "value" : "MIT" } ]} }

2021-10-07 02:58:47    分类:技术分享    artifactory   aql   artifactory-query-lang

Is there any automated way to get artifact download URL back from artifactory?

Is there any automated way to get artifact download URL back ? I'm working with maven projects , I use bamboo for build automation. After successful Build completion, artifacts will be pushed Jfrog artifactory. My requirement here is to get the artifact download URL back in an automated way(Using bamboo Plugins, Rest API, Jfrog CLI, Maven or any other)

2021-09-08 08:45:46    分类:问答    maven   artifactory   bamboo   jfrog-cli   artifactory-query-lang

AQL build domain object does not return results

I'm running into an issue where I'm not able to get any of the queries I'm making on the build domain object to return when using AQL When I make the following curl: curl -X GET -H "X-JFrog-Art-Api: myArtifactroyKey" -H "Cache-Control: no-cache" "https://MyArtifactoryServer/artifactory/api/build/" I get a set of results: { "builds": [ { "uri": "/someBuild", "lastStarted": "2017-02-15T22:02:49.066+0000" }, { "uri": "/someOtherBuild", "lastStarted": "2017-02-15T21:45:09.590+0000" }, "uri": "/someThirdBuild", "lastStarted": "2017-02-15T21:17:38.794+0000" } ], "uri": "https://myArtifactoryServer

2021-07-31 07:15:18    分类:问答    artifactory   artifactory-query-lang

Artifactory AQL Get Specific Properties

I'm using Artifactory 3.5. My artifacts have custom properties. I want to be able to query for all artifacts that have that property and I want the result to show the property and its value. I know I can use: items.find(...).include("property.*") However, this returns all properties for the item matching the find criteria. How can I display only the specific property that I want?

2021-06-24 17:16:03    分类:问答    artifactory   aql   artifactory-query-lang

How to find the latest artifact version with Artifactory Query Language?

Until now, I used the Artifactory REST API to determine the last version (last snapshot) of a maven artifact with groupId and artifactIid: /api/search/latestVersion?g={groupid}&a={artifactid} This gives me exactly a string with the highest/last available (snapshot) version of this artifact. However, this is sometimes really slow and one recommendation was to use the Artifactory Query Language (AQL). Unfortunately I have not yet been able to find out how to map this functionality in AQL. Could someone give me a clue as to what a corresponding query in AQL could look like? Thanks in advance!

2021-06-21 23:23:57    分类:问答    maven   artifactory   jfrog-cli   artifactory-query-lang

Artifactory aql: find builds of job with given property

I am trying to query which build number(s) produced artifacts from build foo with artifact property vcs.Revision=aabbccddee123456. In Artifactory 5.1.3. I was trying like this so far: curl -u user:apikey -i -X POST https://artifactory.foobar.com/artifactory/api/search/aql -H "content-type:text/plain" -T query.json query.json: builds.find( { "module.artifact.item.repo":"snapshot-local", "name":"foo", "module.artifact.item.@vcs.Revision":"aabbccddee123456" } ) However, none of these 3 lines seem individually correct: builds.find({"module.artifact.item.repo":"snapshot-local"}) returns nothing

2021-04-21 04:29:43    分类:问答    artifactory   artifactory-query-lang