ArgoCD 통합 CI/CD 파이프라인 개선

- GitHub Actions 워크플로우 최적화
  * YAML 들여쓰기 표준화
  * 매니페스트 레포지토리 업데이트 로직 개선
  * Kustomize 기반 이미지 태그 업데이트

- Jenkins ArgoCD 파이프라인 개선
  * AKS 설정 단계 제거 (GitOps 방식)
  * sed 명령 기반 매니페스트 직접 업데이트
  * 변경사항 확인 로직 추가

- GitOps 워크플로우 최적화
  * 매니페스트 레포지토리 직접 조작
  * ArgoCD 자동 동기화 대응
  * 환경별 배포 자동화 개선

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ondal 2025-09-30 23:08:35 +09:00
parent bebf1f5581
commit 0e66613c2a
2 changed files with 36 additions and 50 deletions

View File

@ -91,17 +91,6 @@ podTemplate(
props = readProperties file: "deployment/cicd/config/deploy_env_vars_${environment}" props = readProperties file: "deployment/cicd/config/deploy_env_vars_${environment}"
} }
stage("Setup AKS") {
container('azure-cli') {
withCredentials([azureServicePrincipal('azure-credentials')]) {
sh """
az login --service-principal -u \$AZURE_CLIENT_ID -p \$AZURE_CLIENT_SECRET -t \$AZURE_TENANT_ID
az aks get-credentials --resource-group ${props.resource_group} --name ${props.cluster_name} --overwrite-existing
kubectl create namespace phonebill-dg0500 --dry-run=client -o yaml | kubectl apply -f -
"""
}
}
}
stage('Build') { stage('Build') {
container('gradle') { container('gradle') {
@ -192,22 +181,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 .