Update Jenkinsfile - docker image creation & push

This commit is contained in:
themajerr 2023-07-10 12:29:16 +02:00 committed by GitHub
parent 9abc930921
commit a5895aafca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

12
Jenkinsfile vendored
View file

@ -8,22 +8,26 @@ pipeline {
sh './gradlew check'
}
}
stage('PR - Test') {
when { branch 'PR-*' }
steps {
sh './gradlew test'
}
}
stage('PR - Build') {
when { branch 'PR-*' }
steps {
sh './gradlew build'
sh './gradlew clean build'
}
}
stage('PR - Push') {
stage('PR - Build + Push') {
when { branch 'PR-*' }
steps {
sh 'echo "<PLACEHOLDER>"'
sh 'docker build -t us-west3-docker.pkg.dev/playground-s-11-5cd45b0d/docker-registry/petclinic:$(git tag | tail -1)-$(git rev-parse --short HEAD)'
sh 'docker push us-west3-docker.pkg.dev/playground-s-11-5cd45b0d/docker-registry/petclinic'
}
}
@ -33,12 +37,14 @@ pipeline {
sh 'echo "<create tag>"'
}
}
stage('Main - tag the artifact') {
when { branch 'main' }
steps {
sh 'echo "<tag artifact>"'
}
}
stage('Main - push to repo') {
when { branch 'main' }
steps {