push image
Gitea/docker-s3www/pipeline/head This commit looks good Details

This commit is contained in:
dave 2022-04-21 21:48:24 -07:00
parent b64e114b73
commit ff2199750f
1 changed files with 18 additions and 6 deletions

24
Jenkinsfile vendored
View File

@ -1,3 +1,5 @@
def image_name = "dpedu/s3www"
pipeline { pipeline {
agent { agent {
kubernetes { kubernetes {
@ -18,19 +20,29 @@ spec:
} }
} }
stages { stages {
stage("Build iamge") { stage("Build image") {
steps { steps {
container("docker") { container("docker") {
script { script {
def image
try { try {
image = docker.image("dockermirror:5000/dpedu/nagdebbuilder-${distro}") docker.withRegistry('http://dockermirror:5000') {
image.pull() // Pull a recent version to share base layers with (?) docker.image(image_name).pull() // Pull a recent version to share base layers with (?)
}
} catch (exc) { } catch (exc) {
echo "couldn't pull image, assuming we're building it for the first time" echo "couldn't pull image, assuming we're building it for the first time"
image = docker.build("dockermirror:5000/dpedu/s3www",)
} }
// image.push() docker.build(image_name)
}
}
}
}
stage("Push image") {
steps {
container("docker") {
script {
docker.withRegistry('http://dockermirror:5000') {
docker.image(image_name).push("latest")
}
} }
} }
} }