-
Bug
-
Resolution: Unresolved
-
Minor
-
Platform: Ubuntu
File download from Artifactory doesn't work if called from function.
def server = Artifactory.server 'MyServerName' def downloadFile(fileName) { echo "FileName: ${fileName}" // prints "FileName: SomeFile.exe" def downloadSpec = """{ "files": [ { "pattern": "progs-gen-releases/SomeDirectory/${fileName}", "target": "./SomeDirectory/", "flat": "true" } ] }""" server.download(downloadSpec) // <- unknown error in this line } node("NodeName") { ansiColor('xterm') { stage('Some stage') { /* ========= this script works fine ============================= def downloadSpec = """{ "files": [ { "pattern": "progs-gen-releases/SomeDirectory/SomeFile.exe", "target": "./SomeDirectory/", "flat": "true" } ] }""" server.download(downloadSpec) //it works ================================================================*/ downloadFile("SomeFile.exe") //it doesn't work } } }