Update Jenkinsfile

This commit is contained in:
John Hanzu Kim 2025-06-19 15:25:06 +09:00 committed by GitHub
parent 458be8df69
commit f53974812c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
// smarketing-backend/smarketing-java/deployment/Jenkinsfile_ArgoCD
// smarketing-backend/smarketing-java/deployment/Jenkinsfile
def PIPELINE_ID = "${env.BUILD_NUMBER}"
@ -30,6 +30,7 @@ podTemplate(
def MANIFEST_REPO = 'https://github.com/won-ktds/smarketing-manifest.git'
def MANIFEST_CREDENTIAL_ID = 'github-credentials-smarketing'
try {
stage("Get Source") {
checkout scm
@ -222,24 +223,24 @@ ${services.collect { "- ${props.registry}/${props.image_org}/${it}:${imageTag}"
"""
}
}
}
post {
always {
container('docker') {
sh 'docker system prune -f || true'
}
sh 'rm -rf manifest-repo || true'
}
success {
// 성공 시 처리
echo """
✅ CI Pipeline 성공!
🏷️ 새로운 이미지 태그: ${imageTag}
🔄 ArgoCD가 자동으로 배포를 시작합니다
"""
} catch (Exception e) {
// 실패 시 처리
echo "❌ CI Pipeline 실패: ${e.getMessage()}"
throw e
} finally {
// 정리 작업 (항상 실행)
container('docker') {
sh 'docker system prune -f || true'
}
failure {
echo "❌ CI Pipeline 실패!"
sh 'rm -rf manifest-repo || true'
}
}
}