mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 07:45:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
704dbb48b9
commit
5e2ae023e8
1 changed files with 8 additions and 8 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -32,7 +32,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Create docker image') {
|
stage('Create docker image') {
|
||||||
steps {
|
steps {
|
||||||
echo "now we will begin the creation of the docker image"
|
echo "now we will begin the creation of the docker image "
|
||||||
script {
|
script {
|
||||||
def dockerBuildOutput = sh(script: 'docker build -t imagine_spring_petclinic:0.1 .', returnStatus: true)
|
def dockerBuildOutput = sh(script: 'docker build -t imagine_spring_petclinic:0.1 .', returnStatus: true)
|
||||||
if (dockerBuildOutput == 0) {
|
if (dockerBuildOutput == 0) {
|
||||||
|
@ -45,9 +45,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Tag the docker image') {
|
stage('Tag the docker image') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is main
|
// Condition to execute the stage when the branch is mai
|
||||||
changeRequest()
|
changeRequest()
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "now we will tag the docker image "
|
echo "now we will tag the docker image "
|
||||||
script {
|
script {
|
||||||
|
@ -77,7 +77,7 @@ pipeline {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is main
|
// Condition to execute the stage when the branch is main
|
||||||
changeRequest()
|
changeRequest()
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "now we will push to the docker file"
|
echo "now we will push to the docker file"
|
||||||
script {
|
script {
|
||||||
|
@ -98,8 +98,8 @@ pipeline {
|
||||||
stage('Tag docker image again for the main repo') {
|
stage('Tag docker image again for the main repo') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is 'main'
|
// Condition to execute the stage when the branch is 'main'
|
||||||
expression {
|
not {
|
||||||
return env.BRANCH_NAME == 'main'
|
changeRequest()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
@ -117,8 +117,8 @@ pipeline {
|
||||||
stage('Push docker image to main repository') {
|
stage('Push docker image to main repository') {
|
||||||
when {
|
when {
|
||||||
// Condition to execute the stage when the branch is 'main'
|
// Condition to execute the stage when the branch is 'main'
|
||||||
expression {
|
not {
|
||||||
return env.BRANCH_NAME == 'main'
|
changeRequest()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
|
Loading…
Reference in a new issue