adds declarative cersion of pushArtifact

This commit is contained in:
nhyatt committed 2022-02-18 12:15:28 -06:00
1 parent 47cf7ca86d
commit 361a620085
1 file changed
+20
+20
View File
@@ -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 + '"'
}
}
}
}
}
}