我正在Jenkins管道中使用Jenkins JFrog Artifactory插件的rtDownload
DSL块来从Artifactory OSS下载一些工件。这是我的rtDownload步骤的样子。
rtDownload (
serverId: "artifactory",
spec:
"""{
"files": [
{
"pattern": "esb-dev-local/**",
"target": "artifacts/",
"build": "TestJob/58"
}
]
}"""
)
但是,这似乎下载了所有与内部版本名称(TestJob)匹配且未按内部版本号过滤的文件。我可以在人工制品中正确看到Build ID。关于我可能做错了什么的任何线索?
这是詹金斯的输出
[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.
答案 0 :(得分:2)
下载的工件(通过校验和)等于属于所请求构建的工件(名称和编号)。
在多个工件与构建中列出的校验和相匹配的情况下,正确的下载路径由工件的属性(构建名称和编号)确定。但是,由于Artifactory OSS不支持工件属性,因此返回的路径不确定。
这就是为什么您看到从其他内部版本号的路径下载的某些工件的原因。这些工件已正确下载,但路径似乎不同。
答案 1 :(得分:0)
您可以尝试使用json文件中的specPath采购