From 15e00efac6c431841000d630d4a3246bb70f065b Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Fri, 26 Jun 2020 16:36:54 +0100 Subject: [PATCH] [26.06.20] Docker builder change --- configuration/pipelines/build.groovy | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index 86520ff..384d517 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -76,28 +76,16 @@ try { stage('Tag Repository') { withDockerServer([uri: "${env.DOCKER_REPOSITORY_TCP}"]) { - withDockerRegistry([credentialsId: 'Registry', url: "https://registry.cryptosky.me"]) { - 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() - } + docker.build("${env.APPLICATION_NAME}:${env.APPLICATION_VERSION}") + docker.build("${env.APPLICATION_NAME}:latest") + + sh "docker tag ${env.APPLICATION_NAME}:${env.APPLICATION_VERSION} ${env.DOCKER_REPOSITORY}/${env.APPLICATION_NAME}:${env.APPLICATION_VERSION}" + sh "docker tag ${env.APPLICATION_NAME}:latest ${env.DOCKER_REPOSITORY}/${env.APPLICATION_NAME}:latest" + + sh "docker push ${env.DOCKER_REPOSITORY}/${env.APPLICATION_NAME}:${env.APPLICATION_VERSION}" + sh "docker push ${env.DOCKER_REPOSITORY}/${env.APPLICATION_NAME}: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 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" - withCredentials( [usernamePassword( credentialsId: env.GITHUB_CREDENTIALS_ID,