Update Jenkinsfile

This commit is contained in:
surtexx 2023-11-13 15:38:21 +02:00 committed by GitHub
parent 491977d251
commit 95d113f4b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

21
Jenkinsfile vendored
View file

@ -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")
}
}
}
}
}