mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 16:25:49 +00:00
Update Jenkinsfile - docker image creation & push
This commit is contained in:
parent
9abc930921
commit
a5895aafca
1 changed files with 9 additions and 3 deletions
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue