diff --git a/Jenkinsfile b/Jenkinsfile index 14df29782..4550de6f6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,26 @@ pipeline{ sh './mvnw checkstyle:checkstyle' sh './mvnw verify' sh './mvnw clean package' - sh 'docker build -t mr/spring-petclinic:${GIT_COMMIT:0:7} -f Dockerfile2 .' + } + } + stage ("Build Docker Image") { + steps { + script{ + app = docker.build("surtexx/mr:${GIT_COMMIT}", "-f Dockerfile2 .") + app.inside{ + sh 'echo $(curl localhostt:8080)' + } + } + } + } + stage ("Push Docker Image") { + steps { + script{ + docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') { + app.push(${GIT_COMMIT}) + app.push("latest") + } + } } } }