Answer a question

So I am downloading multiple artifacts with 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'
)

Which works but this works async and I have to use the results as soon as it finished. How do I await for each rtDownload in pipeline syntax?

Answers

Below working for me with downloading 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 
...
}

Logo

CI/CD社区为您提供最前沿的新闻资讯和知识内容

更多推荐