mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 13:35:50 +00:00
spin up petclinic container locally
This commit is contained in:
parent
84c6fde127
commit
84ecbcc4f2
1 changed files with 21 additions and 11 deletions
32
Jenkinsfile
vendored
32
Jenkinsfile
vendored
|
@ -15,16 +15,26 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy to Tomcat') {
|
stage('Build container') {
|
||||||
agent {
|
agent any
|
||||||
docker {
|
steps {
|
||||||
image 'alpine'
|
sh 'docker build -t petclinic-tomcat .'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
stage('Deploy container locally') {
|
||||||
sh 'echo deploying to tomcat'
|
agent any
|
||||||
//sh 'cp target/petclinic.war /usr/share/jenkins/ref/tomcat/petclinic.war'
|
steps {
|
||||||
}
|
sh 'docker rm -f petclinic-tomcat-temp || true'
|
||||||
}
|
sh 'docker run -p 18887:8080 -d --name petclinic-tomcat-temp petclinic-tomcat'
|
||||||
|
echo 'Should be available at http://localhost:18887/petclinic/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Stop Container') {
|
||||||
|
agent any
|
||||||
|
steps {
|
||||||
|
input 'Stop container?'
|
||||||
|
sh 'docker rm -f petclinic-tomcat-temp || true'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue