Jenkins Bash 배열 변수 충돌 해결

- Groovy 'services' 변수와 Bash 'services' 배열 이름 충돌 방지
- Bash 배열명을 'svc_list'로 변경하여 syntax error 해결
- 가이드에 변수 충돌 방지 방법과 문제해결 섹션 추가
- Jenkins 파이프라인 안정성 향상 및 범용 적용 가능

🤖 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:14:11 +09:00
parent 125de3b6e2
commit 85ef46a3d1

View File

@ -169,11 +169,11 @@ podTemplate(
# 환경별 디렉토리로 이동
cd deployment/cicd/kustomize/overlays/${environment}
# 서비스 배열 정의
services=(api-gateway user-service bill-service product-service kos-mock)
# 서비스 배열 정의 (Bash 배열)
svc_list=(api-gateway user-service bill-service product-service kos-mock)
# 이미지 태그 업데이트
for service in "\${services[@]}"; do
for service in "\${svc_list[@]}"; do
\$HOME/bin/kustomize edit set image acrdigitalgarage01.azurecr.io/phonebill/\$service:${environment}-${imageTag}
done
@ -182,7 +182,7 @@ podTemplate(
# 배포 상태 확인
echo "Waiting for deployments to be ready..."
for service in "\${services[@]}"; do
for service in "\${svc_list[@]}"; do
kubectl -n phonebill-${environment} wait --for=condition=available deployment/\$service --timeout=300s
done
"""