[英]How do I download the latest INTEGRATION verison of an artifactory dependency
I have an artifactory (generic) build in jenkins.我在 jenkins 中构建了一个人工制品(通用)。 It works very well for publishing but I'm having problems with what to write in the spec file for the "download" section.
它非常适合发布,但我在“下载”部分的规范文件中写入内容时遇到问题。
I want my build to download the latest version of a file from another build.我希望我的构建从另一个构建下载文件的最新版本。 My repo layout is configured so that if I use a url like: http://artiserver:8081/artifactory/infra/package-scripts/[INTEGRATION]/scripts_archive.tar.gz I always get the most recent version of that file.
我的 repo 布局是这样配置的,如果我使用像这样的 url: http://artiserver:8081/artifactory/infra/package-scripts/[INTEGRATION]/scripts_archive.tar.gz,我总是得到该文件的最新版本。
In the "download file" spec section of the generic artifactory integration job config I can write a spec file like so:在通用工件集成作业配置的“下载文件”规范部分中,我可以编写如下规范文件:
{
"files": [
{
"pattern": "infra/package-scripts/32/scripts_archive.tar.gz"
}
]
}
And this works as expected (always getting the 32
version of the artifact. I want to make the job depends on the latest version (ie, what i get from the INTEGRATION link) eg:这按预期工作(总是获得
32
版本的工件。我想让这项工作取决于最新版本(即,我从 INTEGRATION 链接获得的)例如:
{
"files": [
{
"pattern": "infra/package-scripts/[INTEGRATION]/scripts_archive.tar.gz"
}
]
}
Is this possible?这可能吗? Or do I need my job to depend on a promoted build without the numbering?
或者我是否需要我的工作依赖于没有编号的升级版本?
--edit-- - 编辑 -
I've also tried:我也试过:
{
"files": [
{
"aql": {
"items.find" : {
"repo": "infra",
"name": "scripts_archive.tar.gz",
},
"sort": { "$desc": [ "created" ] },
"limit": 1
}
}
]
}
But get syntax errors..但是得到语法错误..
-- edit 2 -- -- 编辑 2 --
Turns out I can't yet use sort/limit in jenkins spec file AQL - https://www.jfrog.com/jira/browse/HAP-832结果我还不能在 jenkins 规范文件 AQL 中使用排序/限制 - https://www.jfrog.com/jira/browse/HAP-832
In version 2.9.0 of the Jenkins Artifactory Plugin, the Download Spec schema was extended to include a new "build" property.在 Jenkins Artifactory 插件的 2.9.0 版中, 下载规范架构被扩展为包括一个新的“构建”属性。 This provides you an additional filtering of the downloaded files, so that they are the artifacts of a specific build.
这为您提供了对下载文件的额外过滤,以便它们是特定构建的工件。 If you don't specify a specific build number, you'll get the artifacts of the latest build published to Artifactory.
如果您没有指定特定的构建号,您将获得发布到 Artifactory 的最新构建的工件。 Please notice that the "build" property can provide the latest build and not the latest version, but if your builds publish build-info to Artifactory, then it actually provides the same outcome.
请注意,“build”属性可以提供最新版本而不是最新版本,但是如果您的版本将构建信息发布到 Artifactory,那么它实际上提供了相同的结果。 Also note that the "pattern" property is still used when specifying the build.
另请注意,在指定构建时仍会使用“模式”属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.