From 5f20bcf0beb2acf0fe29a947ecc343aa63b22212 Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Thu, 19 Dec 2019 16:37:22 -0500 Subject: [PATCH] Update withCredentials --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0c1f3d0..80e2f46 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { //Runs versioning in docker container stage('Self Version') { steps { - withCredentials( [secret( credentialsId: 'RbnDockerRegistry', secretVariable: 'DOCKER_REGISTRY')]) { + withCredentials([string(credentialsId: 'RbnDockerRegistry', variable: 'DOCKER_REGISTRY')]) { runAutoSemver("${DOCKER_REGISTRY}/auto-semver:${SELF_SEMVER_TAG}") } } @@ -36,9 +36,9 @@ pipeline { echo "Building ${env.SERVICE} docker image" - withCredentials( [secret( credentialsId: 'RbnDockerRegistry', secretVariable: 'DOCKER_REGISTRY')]) { + withCredentials([string(credentialsId: 'RbnDockerRegistry', variable: 'DOCKER_REGISTRY')]) { // Docker build flags are set via the getDockerBuildFlags() shared library. - sh "docker build ${getDockerBuildFlags()} -t ${env.DOCKER_REGISTRY}/${env.SERVICE}:${env.VERSION} ." + sh "docker build ${getDockerBuildFlags()} -t ${DOCKER_REGISTRY}/${env.SERVICE}:${env.VERSION} ." } sh "python setup.py sdist" @@ -57,14 +57,14 @@ pipeline { { steps { withEcr { - withCredentials( [secret( credentialsId: 'RbnDockerRegistry', secretVariable: 'DOCKER_REGISTRY')]) { - sh "docker push ${env.DOCKER_REGISTRY}/${env.SERVICE}:${env.VERSION}" + withCredentials([string(credentialsId: 'RbnDockerRegistry', variable: 'DOCKER_REGISTRY')]) { + sh "docker push ${DOCKER_REGISTRY}/${env.SERVICE}:${env.VERSION}" script { if("${env.BRANCH_NAME}" == "develop") { - sh "docker tag ${env.DOCKER_REGISTRY}/${env.SERVICE}:${env.VERSION} ${env.DOCKER_REGISTRY}/${env.SERVICE}:latest" - sh "docker push ${env.DOCKER_REGISTRY}/${env.SERVICE}:latest" + sh "docker tag ${DOCKER_REGISTRY}/${env.SERVICE}:${env.VERSION} ${DOCKER_REGISTRY}/${env.SERVICE}:latest" + sh "docker push ${DOCKER_REGISTRY}/${env.SERVICE}:latest" } } }