pflaenz.li/Jenkinsfile

36 lines
1.1 KiB
Text
Raw Normal View History

2023-04-07 10:58:28 +02:00
pipeline {
agent any
stages {
stage('Pull git') {
2023-04-07 11:02:28 +02:00
steps {
checkout scm
}
2023-04-07 10:58:28 +02:00
}
stage('Build Docker Image') {
steps {
script {
2023-04-18 16:42:45 +02:00
def dockerImage = docker.build('git.thisfro.ch/jenkinsci/pflaenzli', '-f Dockerfile . --tag git.thisfro.ch/jenkinsci/pflaenzli:${env.BUILD_NUMBER} --tag git.thisfro.ch/jenkinsci/pflaenzli:latest')
2023-04-07 10:58:28 +02:00
}
}
}
stage('Push Docker Image') {
steps {
2023-04-18 16:42:45 +02:00
script {
def dockerImage = docker.image('git.thisfro.ch/jenkinsci/pflaenzli:${env.BUILD_NUMBER}')
docker.withRegistry('https://git.thisfro.ch', 'jenkins-ci') {
dockerImage.push()
}
},
2023-04-07 10:58:28 +02:00
script {
2023-04-07 11:41:47 +02:00
def dockerImage = docker.image('git.thisfro.ch/jenkinsci/pflaenzli:latest')
2023-04-07 10:58:28 +02:00
docker.withRegistry('https://git.thisfro.ch', 'jenkins-ci') {
dockerImage.push()
}
}
}
}
}
}