在脚本化管道(从SCM中提取Jenkinsfile)方法中,我们如何将工件发布到Artifactory
?
答案 0 :(得分:0)
您应该使用Artifactory Jenkins Plugin。它使用与Artifactory相关的对象扩展了管道DSL,例如Artifactory
:D
这是文档中的一个示例:
def server = Artifactory.server 'my-server-id'
def uploadSpec = """{
"files": [
{
"pattern": "bazinga/*froggy*.zip",
"target": "bazinga-repo/froggy-files/"
}
]
}"""
server.upload spec: uploadSpec
答案 1 :(得分:-1)
在Jenkins中安装Artifactory plugin后,下面的代码段为我解决了问题。
rtUpload (serverId: "server-id",
failNoOp: true,
spec:
"""{
"files": [
{
"pattern": "build/libs/*.jar",
"target": "libs-release"
}
]
}"""
)