Jenkinsfile: Replace Kustomize with sed for manifest updates

- Remove curl dependency (not available in alpine/git)
- Use sed to directly update deployment.yaml files
- Change directory to hgzero-back/kustomize/base
- Update services list: user, meeting, stt, notification

Fix: curl not found error in manifest update stage
This commit is contained in:
hjmoons 2025-10-30 19:08:57 +09:00
parent 2d096265b5
commit d01d4d0b5d

19
Jenkinsfile vendored
View File

@ -163,21 +163,22 @@ podTemplate(
git clone https://\${GIT_USERNAME}:\${GIT_TOKEN}@\${REPO_URL} manifest-repo
cd manifest-repo
# Kustomize 설치
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sh
chmod +x kustomize
# 각 서비스별 이미지 태그 업데이트 (sed 사용)
cd hgzero-back/kustomize/base
# 각 서비스별 이미지 태그 업데이트
cd hgzero-back/kustomize/overlays/${environment}
services="user meeting stt ai notification"
services="user meeting stt notification"
for service in \$services; do
echo "Updating \$service image tag..."
../../../kustomize edit set image ${registry}/${imageOrg}/\$service:${environment}-${imageTag}
sed -i "s|image: ${registry}/${imageOrg}/\$service:.*|image: ${registry}/${imageOrg}/\$service:${environment}-${imageTag}|g" \\
\$service/deployment.yaml
# 변경 사항 확인
echo "Updated \$service deployment.yaml:"
grep "image: ${registry}/${imageOrg}/\$service" \$service/deployment.yaml
done
# Git 설정 및 푸시
cd ../../../..
cd ../../..
git config user.name "Jenkins"
git config user.email "jenkins@hgzero.com"
git add .