From fe1c7d341c0664044e7553e26e21af7d33149fe8 Mon Sep 17 00:00:00 2001 From: Hyeok-Gyu Lee Date: Thu, 8 Aug 2024 13:43:49 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20jenkinsfile=20docker=20registry=20url?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- finMuse-API/Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/finMuse-API/Jenkinsfile b/finMuse-API/Jenkinsfile index 8389763..8c7791b 100644 --- a/finMuse-API/Jenkinsfile +++ b/finMuse-API/Jenkinsfile @@ -3,9 +3,11 @@ pipeline { environment { REPOSITORY_NAME = 'Backend' + GITHUB_CREDENTIALS = credentials('Github-Credential') + DOCKER_CREDENTIALS = credentials('Docker-Credential') IMAGE_NAME = 'findmuse-api-server' PROJECT_DIRECTORY = 'finMuse-API' - DOCKER_REGISTRY_URL = "findmuse-api-server" + DOCKER_REGISTRY_URL = "${DOCKER_CREDENTIALS_USR}/${IMAGE_NAME}" } stages { @@ -39,7 +41,7 @@ pipeline { withCredentials([usernamePassword(credentialsId: 'Docker-Credential', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { script { def imageTag = "${env.IMAGE_NAME}:${env.BUILD_NUMBER}" - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin" sh "docker tag ${imageTag} ${env.DOCKER_REGISTRY_URL}:${env.BUILD_NUMBER}" sh "docker push ${env.DOCKER_REGISTRY_URL}:${env.BUILD_NUMBER}" }