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 {
agent {
kubernetes {
@ -18,19 +20,29 @@ spec:
}
}
stages {
stage("Build iamge") {
stage("Build image") {
steps {
container("docker") {
script {
def image
try {
image = docker.image("dockermirror:5000/dpedu/nagdebbuilder-${distro}")
image.pull() // Pull a recent version to share base layers with (?)
docker.withRegistry('http://dockermirror:5000') {
docker.image(image_name).pull() // Pull a recent version to share base layers with (?)
}
} catch (exc) {
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")
}
}
}
}