Only grab the upload file if we haven't already grabbed it into the workspace

This commit is contained in:
R. Tyler Croy 2018-01-04 12:38:24 -08:00
parent 4dacb0d02f
commit 5bccaaedcc
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 6 additions and 2 deletions

View File

@ -17,9 +17,13 @@ def call(Map args) {
System.setProperty(propertyName,
'sandbox allow-scripts allow-same-origin;')
}
String uploadScriptName = '__azure-upload.sh'
String uploadScript = libraryResource 'io/codevalet/externalartifacts/upload-file-azure.sh'
writeFile file: uploadScriptName, text: uploadScript
/* Only grab the file if it doesn't exist already */
if (!fileExists(uploadScriptName)) {
String uploadScript = libraryResource 'io/codevalet/externalartifacts/upload-file-azure.sh'
writeFile file: uploadScriptName, text: uploadScript
}
String uploadedUrl
withCredentials([string(credentialsId: 'azure-access-key',