diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index b907459..b5e109e 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -61,8 +61,6 @@ try { stage('Build Image') { mvn 'clean package -DskipTests' - sh "docker build -t db-gateway:${env.APPLICATION_VERSION} -f Dockerfile ." - // Update build config for kubernetes // Update Service yaml for kubernetes // Update route yaml for kubernetes @@ -78,10 +76,18 @@ try { } stage('Tag Repository') { - sh "docker tag db-gateway:${env.APPLICATION_VERSION} ${env.DOCKER_REPOSITORY_URL}/db-gateway:${env.APPLICATION_VERSION}" - withDockerRegistry([ credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) { - sh "docker push ${env.DOCKER_REPOSITORY_URL}/db-gateway:${env.APPLICATION_VERSION}" + + withDockerServer([uri: "tcp://registry.cryptosky.me:4243"]) { + withDockerRegistry([credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) { + // we give the image the same version as the .war package + def image = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}") + image.push() } + } +// sh "docker tag db-gateway:${env.APPLICATION_VERSION} ${env.DOCKER_REPOSITORY_URL}/db-gateway:${env.APPLICATION_VERSION}" +// withDockerRegistry([ credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) { +// sh "docker push ${env.DOCKER_REPOSITORY_URL}/db-gateway:${env.APPLICATION_VERSION}" +// } } } }