2

所以我正在用 jFrog 下载多个工件

rtDownload (
serverId: 'Artifactory-1',
spec: '''{
      "files": [
        {
          "pattern": "bazinga-repo/froggy-files/",
          "target": "bazinga/"
        }
      ]
}''',

// Optional - Associate the downloaded files with the following custom build name and build number,
// as build dependencies.
// If not set, the files will be associated with the default build name and build number (i.e the
// the Jenkins job name and number).
buildName: 'holyFrog',
buildNumber: '42'
)

哪个有效,但这是异步的,我必须在完成后立即使用结果。如何在管道语法中等待每个 rtDownload?

4

1 回答 1

0

下面为我​​下载 2 个 Artifacts :

def target = params.BuildInfo.trim()

def downloadSpec = """{
  "files": [{
    "pattern": "${artifactory}.zip",
    "target": "./${target}.zip"
  }]
}"""

def buildInfo = server.download spec: downloadSpec
def files = findFiles(glob: "**/${target}.zip") // Define `files` here

if (files) { // And verify `it` here, so it'll wait 
...
}

于 2021-07-20T11:10:16.440 回答