From 125de3b6e24eb376578426eb4a067fd936624389 Mon Sep 17 00:00:00 2001 From: hiondal Date: Fri, 12 Sep 2025 21:03:19 +0900 Subject: [PATCH] =?UTF-8?q?Kustomize=20=EC=9E=91=EC=97=85=20=EB=94=94?= =?UTF-8?q?=EB=A0=89=ED=86=A0=EB=A6=AC=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 모든 명령을 단일 sh 블록에서 실행하여 작업 디렉토리 유지 - Bash 배열과 for 루프로 서비스 처리 방식 변경 - Jenkins 쉘 세션 분리로 인한 kustomization.yaml 인식 오류 해결 - PATH 환경변수와 cd 명령 효과가 모든 후속 명령에 지속 적용 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- deployment/cicd/Jenkinsfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/deployment/cicd/Jenkinsfile b/deployment/cicd/Jenkinsfile index 4c33e25..66cf03e 100644 --- a/deployment/cicd/Jenkinsfile +++ b/deployment/cicd/Jenkinsfile @@ -168,24 +168,24 @@ podTemplate( # 환경별 디렉토리로 이동 cd deployment/cicd/kustomize/overlays/${environment} - """ - - // 이미지 태그 업데이트 - services.each { service -> - sh "\$HOME/bin/kustomize edit set image acrdigitalgarage01.azurecr.io/phonebill/${service}:${environment}-${imageTag}" - } - sh """ + # 서비스 배열 정의 + services=(api-gateway user-service bill-service product-service kos-mock) + + # 이미지 태그 업데이트 + for service in "\${services[@]}"; do + \$HOME/bin/kustomize edit set image acrdigitalgarage01.azurecr.io/phonebill/\$service:${environment}-${imageTag} + done + # 매니페스트 적용 kubectl apply -k . # 배포 상태 확인 echo "Waiting for deployments to be ready..." + for service in "\${services[@]}"; do + kubectl -n phonebill-${environment} wait --for=condition=available deployment/\$service --timeout=300s + done """ - - services.each { service -> - sh "kubectl -n phonebill-${environment} wait --for=condition=available deployment/${service} --timeout=300s" - } } }