Issue
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?
Solution
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
...
}
Answered By - Khoa
Answer Checked By - Timothy Miller (JavaFixing Admin)