Jenkins ArgoCD 파이프라인 매니페스트 업데이트 로직 개선

- 매니페스트 레포지토리 클론 로직 추가
- 각 서비스별 이미지 태그 자동 업데이트 (sed 명령 사용)
- Git 인증 정보를 활용한 안전한 푸시 구현
- 배포 완료 메시지 및 ArgoCD 자동 배포 안내

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hiondal 2025-09-16 02:09:37 +09:00
parent 15d8d220e7
commit c5089d59b5

View File

@ -179,22 +179,19 @@ podTemplate(
git clone https://\${GIT_USERNAME}:\${GIT_TOKEN}@\${REPO_URL} manifest-repo git clone https://\${GIT_USERNAME}:\${GIT_TOKEN}@\${REPO_URL} manifest-repo
cd manifest-repo cd manifest-repo
# Kustomize 설치 # 각 서비스별 이미지 태그 업데이트 (sed 명령 사용)
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
mkdir -p \$HOME/bin && mv kustomize \$HOME/bin/
export PATH=\$PATH:\$HOME/bin
# 환경별 매니페스트 업데이트
cd phonebill/kustomize/overlays/${environment}
# 각 서비스별 이미지 태그 업데이트
services="api-gateway user-service bill-service product-service kos-mock" services="api-gateway user-service bill-service product-service kos-mock"
for service in \$services; do for service in \$services; do
\$HOME/bin/kustomize edit set image acrdigitalgarage01.azurecr.io/phonebill/\$service:${environment}-${imageTag} echo "Updating \$service image tag..."
sed -i "s|image: acrdigitalgarage01.azurecr.io/phonebill/\$service:.*|image: acrdigitalgarage01.azurecr.io/phonebill/\$service:${environment}-${imageTag}|g" \\
phonebill/kustomize/base/\$service/deployment.yaml
# 변경 사항 확인
echo "Updated \$service deployment.yaml:"
grep "image: acrdigitalgarage01.azurecr.io/phonebill/\$service" phonebill/kustomize/base/\$service/deployment.yaml
done done
# Git 설정 및 푸시 # Git 설정 및 푸시
cd ../../../..
git config user.name "Jenkins CI" git config user.name "Jenkins CI"
git config user.email "jenkins@example.com" git config user.email "jenkins@example.com"
git add . git add .