Kustomize 작업 디렉토리 문제 해결

- 모든 명령을 단일 sh 블록에서 실행하여 작업 디렉토리 유지
- Bash 배열과 for 루프로 서비스 처리 방식 변경
- Jenkins 쉘 세션 분리로 인한 kustomization.yaml 인식 오류 해결
- PATH 환경변수와 cd 명령 효과가 모든 후속 명령에 지속 적용

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hiondal 2025-09-12 21:03:19 +09:00
parent 97117b6ec4
commit 125de3b6e2

View File

@ -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}"
}
# 서비스 배열 정의
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
sh """
# 매니페스트 적용
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"
}
}
}