adds declarative cersion of pushArtifact
This commit is contained in:
parent
47cf7ca86d
commit
361a620085
20
vars/declarativeFunctions.groovy
Normal file
20
vars/declarativeFunctions.groovy
Normal 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 + '"'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user