This commit is contained in:
Oleg Mykolaishyn 2021-03-26 11:44:16 +02:00
parent 6569847067
commit 151807900b

View file

@ -2,9 +2,9 @@
pipeline { pipeline {
environment { environment {
registry = "owlleg68/petclinic" registry = "owlleg68/spring-petclinic"
registryCredential = 'dockerhub_id' registryCredential = 'dockerhub_id'
dockerImage = 'spring-petclinic:2.4.2' dockerImage = ''
} }
agent { agent {
@ -34,24 +34,27 @@ pipeline {
} }
} }
stage('Build Docker image with Spring') { stage('Build Docker image') {
steps { steps {
//script{ script{
// dockerImage = docker.build registry dockerImage = docker.build registry
//} }
sh 'mvn spring-boot:build-image' //sh 'mvn spring-boot:build-image'
} }
} }
stage('Push Image') { stage('Push Image') {
script { steps {
docker.withRegistry( 'spring-petclinic:2.4.2', registryCredential ) { script {
dockerImage.push() docker.withRegistry( '', registryCredential ) {
dockerImage.push()
}
}
} }
} }
}
stage('Artifacts') { stage('Artifacts') {
steps { steps {