From be58e4b8018c089099e087a6b21e039097cdf9c7 Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Fri, 26 Jun 2020 13:32:26 +0100 Subject: [PATCH] [26.06.20] Docker stuff --- configuration/pipelines/build.groovy | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index fcc4fa2..a8e7208 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -75,17 +75,19 @@ try { stage('Tag Repository') { - def image = docker.build("db-gateway:${env.APPLICATION_VERSION}") - def latest = docker.build("db-gateway:latest") + withDockerServer([uri: "${env.DOCKER_REPOSITORY_TCP}"]) { + def image = docker.build("db-gateway:${env.APPLICATION_VERSION}") + def latest = docker.build("db-gateway:latest") - sh "docker build -t db-gateway:${env.APPLICATION_VERSION}" - sh "docker build -t 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 tag db-gateway:${env.APPLICATION_VERSION} ${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}" - sh "docker tag db-gateway:latest ${env.DOCKER_REPOSITORY}/db-gateway:latest" + sh "docker push ${env.DOCKER_REPOSITORY}/${image}" + sh "docker push ${env.DOCKER_REPOSITORY}/${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" withCredentials( [usernamePassword(