diff --git a/vars/declarativeFunctions.groovy b/vars/declarativeFunctions.groovy new file mode 100644 index 0000000..379c90d --- /dev/null +++ b/vars/declarativeFunctions.groovy @@ -0,0 +1,20 @@ +#!groovy + +def pushArtifact (Map config) { + def ws = pwd() + stage ("Push Artifact: " + config.fileName) { + steps { + container ("alpine") { + script { + sh "apk add --no-cache curl" + withCredentials([usernameColonPassword( + credentialsId: config.repoCreds, + variable: "aCreds" + )]) { + sh 'curl --fail --request PUT --user "$aCreds" --upload-file "' + config.filePath + config.fileName + '" "' + config.fileURL + config.fileName + '"' + } + } + } + } + } +} \ No newline at end of file