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
7e46224ad9
commit
604af1c2c2
1 changed files with 21 additions and 8 deletions
29
Jenkinsfile
vendored
29
Jenkinsfile
vendored
|
@ -1,12 +1,12 @@
|
|||
pipeline{
|
||||
agent any
|
||||
when {
|
||||
expression {
|
||||
return env.CHANGE_ID != null
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage ("build") {
|
||||
when {
|
||||
expression {
|
||||
return env.CHANGE_ID != null
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "Running build automation..."
|
||||
sh './mvnw checkstyle:checkstyle'
|
||||
|
@ -15,6 +15,11 @@ pipeline{
|
|||
}
|
||||
}
|
||||
stage ("Build Docker Image") {
|
||||
when {
|
||||
expression {
|
||||
return env.CHANGE_ID != null
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
app = docker.build("surtexx/mr:${GIT_COMMIT[0..7]}", "-f Dockerfile1 .")
|
||||
|
@ -22,6 +27,11 @@ pipeline{
|
|||
}
|
||||
}
|
||||
stage ("Push Docker Image") {
|
||||
when {
|
||||
expression {
|
||||
return env.CHANGE_ID != null
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
|
||||
|
@ -36,11 +46,11 @@ pipeline{
|
|||
|
||||
pipeline{
|
||||
agent any
|
||||
when{
|
||||
branch: 'main'
|
||||
}
|
||||
stages{
|
||||
stage ("Build Docker Image") {
|
||||
when{
|
||||
branch: 'main'
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
app = docker.build("surtexx/main", "-f Dockerfile1 .")
|
||||
|
@ -48,6 +58,9 @@ pipeline{
|
|||
}
|
||||
}
|
||||
stage ("Push Docker Image") {
|
||||
when{
|
||||
branch: 'main'
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
|
||||
|
|
Loading…
Reference in a new issue