From b6dcb0d6d0c3f2f44c03512e30f838e4c41c0434 Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Fri, 26 Jun 2020 14:02:16 +0100 Subject: [PATCH] [26.06.20] Docker builder change --- configuration/pipelines/build.groovy | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index f45b826..e0fc50f 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -76,16 +76,25 @@ try { stage('Tag Repository') { withDockerServer([uri: "${env.DOCKER_REPOSITORY_TCP}"]) { - def image = docker.build("db-gateway:${env.APPLICATION_VERSION}") - def latest = docker.build("db-gateway:latest") - - sh "docker tag ${image} ${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}" - sh "docker tag ${latest} ${env.DOCKER_REPOSITORY}/db-gateway:latest" - - sh "docker push ${env.DOCKER_REPOSITORY}/${image}" - sh "docker push ${env.DOCKER_REPOSITORY}/${latest}" + withDockerRegistry([credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) { + def image = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}") + image.push() + def latest = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:latest") + latest.push() + } } +// withDockerServer([uri: "${env.DOCKER_REPOSITORY_TCP}"]) { +// def image = docker.build("db-gateway:${env.APPLICATION_VERSION}") +// def latest = docker.build("db-gateway:latest") +// +// sh "docker tag ${image} ${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}" +// sh "docker tag ${latest} ${env.DOCKER_REPOSITORY}/db-gateway:latest" +// +// sh "docker push ${env.DOCKER_REPOSITORY}/${image}" +// sh "docker push ${env.DOCKER_REPOSITORY}/${latest}" +// } + // sh "docker build -t db-gateway:${env.APPLICATION_VERSION}" // sh "docker build -t db-gateway:latest"