docker-s3www/Jenkinsfile

40 lines
1.0 KiB
Groovy

pipeline {
agent {
kubernetes {
// inheritFrom 'mypod'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: docker
image: docker:20-dind
args:
- "--insecure-registry"
- "dockermirror:5000"
securityContext:
privileged: true
"""
}
}
stages {
stage("Build iamge") {
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 (?)
} 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()
}
}
}
}
}
}