From 26064b20b81c1d3177bb49c4787ee842f6794db4 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 20 Feb 2019 08:25:12 +1000 Subject: [PATCH] Fix PR docker image pushing to wrong repo --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ac8fd56..c31f7e01 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,11 +31,11 @@ pipeline { // Docker Build sh 'docker build --pull --no-cache --squash --compress -t ${TEMP_IMAGE} .' - // Private Registry - sh 'docker tag ${TEMP_IMAGE} ${DOCKER_PRIVATE_REGISTRY}/${IMAGE}:github-${BRANCH_LOWER}' - withCredentials([usernamePassword(credentialsId: 'jc21-private-registry', passwordVariable: 'dpass', usernameVariable: 'duser')]) { - sh "docker login -u '${duser}' -p '${dpass}' ${DOCKER_PRIVATE_REGISTRY}" - sh 'docker push ${DOCKER_PRIVATE_REGISTRY}/${IMAGE}:github-${BRANCH_LOWER}' + // Dockerhub + sh 'docker tag ${TEMP_IMAGE} docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}' + withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { + sh "docker login -u '${duser}' -p '${dpass}'" + sh 'docker push docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}' } sh 'docker rmi ${TEMP_IMAGE}'