adds artifact push to
This commit is contained in:
parent
a59322aa74
commit
ea0ed188c1
@ -28,7 +28,14 @@ spec:
|
||||
tty: true
|
||||
"""
|
||||
}
|
||||
|
||||
if (config.fedora == true) {
|
||||
output += """
|
||||
- name: fedora
|
||||
imagePullPolicy: Always
|
||||
image: ${config.repo}/dockerhub/library/fedora:latest
|
||||
tty: true
|
||||
"""
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
@ -45,7 +52,7 @@ def deletePod (Map config) {
|
||||
withKubeConfig ([
|
||||
credentialsId: config.kubeAuth,
|
||||
serverUrl: config.kubeURL,
|
||||
namespace: config.namespace,
|
||||
namespace: config.namespace
|
||||
]) {
|
||||
sh "for i in \$(kubectl get pods --selector ${config.selector} -o name); do kubectl delete \${i}; done"
|
||||
}
|
||||
@ -60,7 +67,7 @@ def buildContainer (Map config, List buildArg = []) {
|
||||
writeFile (file: ws + "/Dockerfile", text: config.dockerFile)
|
||||
withCredentials([usernameColonPassword(
|
||||
credentialsId: config.repoCreds,
|
||||
variable: "dCreds",
|
||||
variable: "dCreds"
|
||||
)]) {
|
||||
sh "set +x; printf '{\"auths\":{\"%s\":{\"auth\": \"%s\"}}}' \"${config.repository}\" \"${dcreds.bytes.encodeBase64().toString()}\" > /kaniko/.docker/config.json"
|
||||
}
|
||||
@ -78,3 +85,18 @@ def buildContainer (Map config, List buildArg = []) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def pushArtifact (Map config) {
|
||||
def ws = pwd()
|
||||
stage ("Push Artifact") {
|
||||
container ("alpine") {
|
||||
sh "apk add --no-cache curl"
|
||||
withCredentials([usernameColonPassword(
|
||||
credentialsId: config.repoCreds,
|
||||
variable: "aCreds"
|
||||
)]) {
|
||||
sh 'curl --request PUT --user "$aCreds" --upload-file "' + config.fileName + '" "' + config.filePath + '"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user