Skip to content

Commit

Permalink
[fix] jenkinsfile docker registry url 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ehyeok9 committed Aug 8, 2024
1 parent e9a5ce4 commit fe1c7d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions finMuse-API/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}"
}
Expand Down

0 comments on commit fe1c7d3

Please sign in to comment.