spin up petclinic container locally

This commit is contained in:
Benjamin Stein 2017-07-25 14:41:25 -07:00
parent 84c6fde127
commit 84ecbcc4f2

26
Jenkinsfile vendored
View file

@ -15,15 +15,25 @@ pipeline {
} }
} }
} }
stage('Deploy to Tomcat') { stage('Build container') {
agent { agent any
docker {
image 'alpine'
}
}
steps { steps {
sh 'echo deploying to tomcat' sh 'docker build -t petclinic-tomcat .'
//sh 'cp target/petclinic.war /usr/share/jenkins/ref/tomcat/petclinic.war' }
}
stage('Deploy container locally') {
agent any
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'
} }
} }
} }