简体   繁体   English

Artifactory Jenkins 插件下载命令不遵守规范中的构建信息

[英]Artifactory Jenkins plugin download command not honouring build info in spec

I am using rtDownload DSL block of the Jenkins JFrog Artifactory plugin in my Jenkins pipeline to download some artifacts from Artifactory OSS.我在我的 Jenkins 管道中使用 Jenkins JFrog Artifactory 插件的rtDownload DSL 块从 Artifactory OSS 下载一些工件。 This is how my rtDownload step looks.这就是我的 rtDownload 步骤的样子。

      rtDownload (
        serverId: "artifactory",
        spec:
              """{
                "files": [
                  {
                    "pattern": "esb-dev-local/**",
                    "target": "artifacts/",          
                    "build": "TestJob/58"
                  }
               ]
              }"""
      )

However, this seems to download all the files that match the Build Name (TestJob) and doesn't filter by the build number.但是,这似乎会下载与构建名称 (TestJob) 匹配的所有文件,并且不会按构建编号进行过滤。 I can see the Build IDs in artifactory correctly.我可以正确地看到 artifactory 中的 Build ID。 Any clues on what I may be doing wrong?关于我可能做错了什么的任何线索?

Here's the output from Jenkins这是詹金斯的输出

[Pipeline] rtDownload
Downloading artifacts using pattern: esb-dev-local/**
Beginning to resolve Build Info published dependencies.
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.pom'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.pom' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_58/<MASKED>-1.0_58.pom'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58-cfg.zip'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58-cfg.zip' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_58/<MASKED>-1.0_58-cfg.zip'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.pom'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.pom' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_58/<MASKED>-1.0_58.pom'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_32/<MASKED>-1.0_32.pom'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_32/<MASKED>-1.0_32.pom' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_32/<MASKED>-1.0_32.pom'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.jar'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.jar' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_58/<MASKED>-1.0_58.jar'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.jar'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_58/<MASKED>-1.0_58.jar' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_58/<MASKED>-1.0_58.jar'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_46/<MASKED>-1.0_46.pom'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_46/<MASKED>-1.0_46.pom' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_46/<MASKED>-1.0_46.pom'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/${projVersion}/<MASKED>-${projVersion}.pom'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/${projVersion}/<MASKED>-${projVersion}.pom' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/${projVersion}/<MASKED>-${projVersion}.pom'
Downloading 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_33/<MASKED>-1.0_33.pom'...
Successfully downloaded 'http://<MASKED>:8081/artifactory/esb-dev-local/<MASKED>/1.0_33/<MASKED>-1.0_33.pom' to '/var/lib/jenkins/workspace/<MASKED>/artifacts/<MASKED>/1.0_33/<MASKED>-1.0_33.pom'
Finished resolving Build Info published dependencies.

The artifacts downloaded are equal (by checksum) to the ones belong to the requested build (name & number).下载的工件(通过校验和)与属于请求的构建(名称和编号)的工件相同。

In the scenario where several artifacts match a checksum listed in a build, the correct download path is determined by the artifact's properties (build name & number).在多个工件与构建中列出的校验和匹配的情况下,正确的下载路径由工件的属性(构建名称和编号)确定。 However, since Artifactory OSS does not support artifacts properties, the path returned is undetermined.但是,由于 Artifactory OSS 不支持 artifacts 属性,返回的路径是不确定的。

This is why you see some artifacts downloaded from the paths of other build numbers.这就是为什么您会看到一些从其他版本号的路径下载的工件。 These artifacts were correctly downloaded, but from a seemingly different path.这些工件已正确下载,但来自看似不同的路径。

您可以尝试使用来自 json 文件的 specPath 采购

暂无
暂无

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

相关问题 无法使用文件规范中带有“ build”属性的人工插件或jfrog cli下载最新工件 - Cannot download latest artifact using artifactory plugin or jfrog cli with “build” property in file spec Jenkins Pipeline Artifactory插件错误:无法读取生成的生成信息 - Jenkins Pipeline Artifactory Plugin Error: Couldn't read generated build info 使用Jenkins中的Artifactory插件有条件地从工件下载文件 - Use the Artifactory Plugin in Jenkins to conditionally download files from artifactory Jenkins Artifactory插件-如果上传失败,构建失败 - Jenkins Artifactory Plugin - Fail build if upload fails Jenkins-将Artifactory网址传递给升级的构建插件 - Jenkins - Pass Artifactory Url to Promoted Build Plugin 如何使用 Curl 命令在没有插件的情况下将最新的工件从 jfrog Artifactory 存储库下载到 jenkins 声明管道? - How to download the LATEST artifact from jfrog Artifactory repository to jenkins declarative pipeline without plugin using Curl command? 通过cli或jenkins插件将构建部署到工件 - deploy build to artifactory via cli or jenkins plugin 如何从 jenkins 上传 maven 包并将信息构建到工件 - How to upload maven packages and build info to artifactory from jenkins Jenkins + Gradle + Artifactory:无法读取生成的构建信息 - Jenkins + Gradle + Artifactory: Couldn't read generated build info Jenkins Artifactory Plugin AQL下载最新神器匹配模式 - Jenkins Artifactory Plugin AQL download latest artifact matching pattern
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM