我正在使用jenkins人工插件,并使用rtUpload上传tar文件。
完成后,是否有办法获取工件URI?
它确实将其打印为日志:
[管道] rtUpload
17:01:50 [consumer_0]部署工件:http://x.x.x.x:8081/artifactory/my-local/snapshot/mor_v.tar.gz。
最佳答案
此功能目前仅在脚本化管道上可用,并在documentation中进行了描述。
例如:
node {
def server = Artifactory.server SERVER_ID
def uploadSpec = readFile 'uploadSpec.json'
def buildInfo = server.upload spec: uploadSpec
if (buildInfo.getArtifacts().size() > 0) {
def localPath = buildInfo.getArtifacts()[0].getLocalPath()
def remotePath = buildInfo.getArtifacts()[0].getRemotePath()
def md5 = buildInfo.getArtifacts()[0].getMd5()
def sha1 = buildInfo.getArtifacts()[0].getSha1()
echo remotePath
}
server.publishBuildInfo buildInfo
}