2026-02-24 08:15:17 +09:00
|
|
|
pipeline {
|
|
|
|
|
agent any
|
|
|
|
|
|
|
|
|
|
environment {
|
|
|
|
|
DEPLOY_USER = 'hskwon'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stages {
|
|
|
|
|
stage('Checkout') {
|
|
|
|
|
steps { checkout scm }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── main → 운영서버 Production 배포 ──
|
|
|
|
|
stage('Deploy Production') {
|
|
|
|
|
when { branch 'main' }
|
|
|
|
|
steps {
|
|
|
|
|
sshagent(credentials: ['deploy-ssh-key']) {
|
|
|
|
|
sh """
|
|
|
|
|
rsync -az --delete \
|
|
|
|
|
--exclude='.git' \
|
|
|
|
|
--exclude='.env' \
|
|
|
|
|
--exclude='storage' \
|
|
|
|
|
. ${DEPLOY_USER}@211.117.60.189:/home/webservice/sales/
|
|
|
|
|
|
|
|
|
|
ssh ${DEPLOY_USER}@211.117.60.189 'cd /home/webservice/sales && echo "sales deployed"'
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
post {
|
2026-02-24 20:47:04 +09:00
|
|
|
success {
|
|
|
|
|
slackSend channel: '#product_infra', color: 'good',
|
|
|
|
|
message: "✅ *sales* 배포 성공 (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|빌드 #${env.BUILD_NUMBER}>"
|
|
|
|
|
}
|
|
|
|
|
failure {
|
|
|
|
|
slackSend channel: '#product_infra', color: 'danger',
|
|
|
|
|
message: "❌ *sales* 배포 실패 (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|빌드 #${env.BUILD_NUMBER}>"
|
|
|
|
|
}
|
2026-02-24 08:15:17 +09:00
|
|
|
}
|
|
|
|
|
}
|