mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 09:25:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
b01467cb77
commit
1e7b5c7810
1 changed files with 25 additions and 24 deletions
49
Jenkinsfile
vendored
49
Jenkinsfile
vendored
|
@ -5,33 +5,34 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
echo 'Running build automation'
|
echo 'Running build automation'
|
||||||
sh './mvnw package'
|
sh './mvnw package'
|
||||||
|
archiveArtifacts artifacts: '/trainSchedule.zip'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
stage('Build Docker Image') {
|
|
||||||
when {
|
|
||||||
branch 'master'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
app = docker.build("sprientera/pets")
|
|
||||||
app.inside {
|
|
||||||
sh 'echo $(curl localhost:80)'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Push Docker Image') {
|
|
||||||
when {
|
|
||||||
branch 'master'
|
|
||||||
}
|
}
|
||||||
steps {
|
stage('Build Docker Image') {
|
||||||
script {
|
when {
|
||||||
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
|
branch 'master'
|
||||||
app.push("${env.BUILD_NUMBER}")
|
}
|
||||||
app.push("latest")
|
steps {
|
||||||
|
script {
|
||||||
|
app = docker.build("sprientera/pet")
|
||||||
|
app.inside {
|
||||||
|
sh 'echo $(curl localhost:8080)'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('Push Docker Image') {
|
||||||
}
|
when {
|
||||||
|
branch 'master'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
|
||||||
|
app.push("${env.BUILD_NUMBER}")
|
||||||
|
app.push("latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue