简体   繁体   English

如何下载工件依赖项的最新集成版本

[英]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.

相关问题 如何在Windows机器上从Jfrog Artifactory下载最新的工件 - How to download the latest Artifacts from Jfrog Artifactory on a Windows Machine 如何使用 Curl 命令在没有插件的情况下将最新的工件从 jfrog Artifactory 存储库下载到 jenkins 声明管道? - How to download the LATEST artifact from jfrog Artifactory repository to jenkins declarative pipeline without plugin using Curl command? Jenkins Artifactory Plugin AQL下载最新神器匹配模式 - Jenkins Artifactory Plugin AQL download latest artifact matching pattern 如何使用Filespec捆绑JFrog Artifactory中的工件? - How Do I Bundle Artifacts in JFrog Artifactory Using Filespecs? 我如何在 curl 命令中使用通配符 * 从 artifactory sevrer 下载 zip 格式的构建文件。? - how can i use wildcard * in curl command to download build file in zip format from artifactory sevrer.? 如何在人工工厂中进行代码推广 - How to do Code Promotion in Artifactory 最新的 Jenkins 和 Artifactory 插件 - Latest Jenkins and Artifactory plugin jenkins与工件5.5.2的集成 - jenkins integration with artifactory 5.5.2 詹金斯人工工厂整合 - Jenkins Artifactory Integration 无法使用文件规范中带有“ build”属性的人工插件或jfrog cli下载最新工件 - Cannot download latest artifact using artifactory plugin or jfrog cli with “build” property in file spec
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM