35 lines
No EOL
1.1 KiB
Groovy
35 lines
No EOL
1.1 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
stages {
|
|
stage("Pull git") {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
|
|
stage("Build Docker Image") {
|
|
steps {
|
|
script {
|
|
def dockerImage = docker.build("git.thisfro.ch/pflaenz.li/pflaenzli", "-f Dockerfile . --tag git.thisfro.ch/pflaenz.li/pflaenzli:${BUILD_NUMBER} --tag git.thisfro.ch/pflaenz.li/pflaenzli:latest")
|
|
}
|
|
}
|
|
}
|
|
|
|
stage("Push Docker Image") {
|
|
steps {
|
|
script {
|
|
def numberTagImage = docker.image("git.thisfro.ch/pflaenz.li/pflaenzli:${BUILD_NUMBER}")
|
|
docker.withRegistry("https://git.thisfro.ch", "jenkins-ci") {
|
|
numberTagImage.push()
|
|
}
|
|
|
|
def latestTagImage = docker.image("git.thisfro.ch/pflaenz.li/pflaenzli:latest")
|
|
docker.withRegistry("https://git.thisfro.ch", "jenkins-ci") {
|
|
latestTagImage.push()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |