mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:35:50 +00:00
Update Jenkinsfile
This commit is contained in:
parent
5e2ae023e8
commit
73f9c65d76
1 changed files with 6 additions and 12 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -4,6 +4,7 @@ pipeline {
|
|||
DOCKERHUB_CREDENTIALS = credentials('mihaivalentingeorgescu-dockerhub')
|
||||
}
|
||||
stages {
|
||||
|
||||
stage('Checkstyle') {
|
||||
steps {
|
||||
sh 'export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64'
|
||||
|
@ -45,8 +46,7 @@ pipeline {
|
|||
}
|
||||
stage('Tag the docker image') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is mai
|
||||
changeRequest()
|
||||
expression { currentBuild.changeSets == null }
|
||||
}
|
||||
steps {
|
||||
echo "now we will tag the docker image "
|
||||
|
@ -75,8 +75,7 @@ pipeline {
|
|||
}
|
||||
stage('Push to DockerHub') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is main
|
||||
changeRequest()
|
||||
expression { currentBuild.changeSets == null }
|
||||
}
|
||||
steps {
|
||||
echo "now we will push to the docker file"
|
||||
|
@ -97,10 +96,7 @@ pipeline {
|
|||
}
|
||||
stage('Tag docker image again for the main repo') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is 'main'
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
expression { currentBuild.changeSets != null }
|
||||
}
|
||||
steps {
|
||||
echo "now we will tag the docker image for the main branch"
|
||||
|
@ -117,9 +113,7 @@ pipeline {
|
|||
stage('Push docker image to main repository') {
|
||||
when {
|
||||
// Condition to execute the stage when the branch is 'main'
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
expression { currentBuild.changeSets != null }
|
||||
}
|
||||
steps {
|
||||
echo "now we will push the image to the docker main repository"
|
||||
|
|
Loading…
Reference in a new issue