feat: enhance Jenkins pipeline with Discord notifications and model hot-reload functionality

- Added a new stage to the Jenkins pipeline to notify Discord when a build starts, succeeds, or fails, improving communication during the CI/CD process.
- Implemented model hot-reload functionality in the MLFilter class, allowing automatic reloading of models when file changes are detected, enhancing responsiveness to updates.
- Updated deployment scripts to provide clearer messaging regarding model loading and container status, improving user experience and debugging capabilities.
This commit is contained in:
21in7
2026-03-01 21:46:36 +09:00
parent d9238afaf9
commit c6428af64e
4 changed files with 102 additions and 12 deletions

30
Jenkinsfile vendored
View File

@@ -7,9 +7,24 @@ pipeline {
IMAGE_TAG = "${env.BUILD_NUMBER}"
FULL_IMAGE = "${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}"
LATEST_IMAGE = "${REGISTRY}/${IMAGE_NAME}:latest"
// 젠킨스 자격 증명에 저장해둔 디스코드 웹훅 주소를 불러옵니다.
DISCORD_WEBHOOK = credentials('discord-webhook')
}
stages {
// 빌드가 시작되자마자 알림을 보냅니다.
stage('Notify Build Start') {
steps {
sh """
curl -H "Content-Type: application/json" \
-X POST \
-d '{"content": "🚀 **[빌드 시작]** `cointrader` (Build #${env.BUILD_NUMBER}) 배포 파이프라인 가동"}' \
${DISCORD_WEBHOOK}
"""
}
}
stage('Git Clone from Gitea') {
steps {
git branch: 'main',
@@ -55,12 +70,25 @@ pipeline {
}
}
// 파이프라인 결과에 따른 디스코드 알림
post {
success {
echo "Build #${env.BUILD_NUMBER} 성공: ${FULL_IMAGE} → 운영 LXC(10.1.10.24) 배포 완료"
sh """
curl -H "Content-Type: application/json" \
-X POST \
-d '{"content": "✅ **[배포 성공]** `cointrader` (Build #${env.BUILD_NUMBER}) 운영 서버(10.1.10.24) 배포 완료!\\n- 📦 이미지: `${FULL_IMAGE}`"}' \
${DISCORD_WEBHOOK}
"""
}
failure {
echo "Build #${env.BUILD_NUMBER} 실패"
sh """
curl -H "Content-Type: application/json" \
-X POST \
-d '{"content": "❌ **[배포 실패]** `cointrader` (Build #${env.BUILD_NUMBER}) 파이프라인 에러 발생. 젠킨스 로그를 확인해 주세요!"}' \
${DISCORD_WEBHOOK}
"""
}
}
}
}