ci: add Jenkinsfile for CI/CD pipeline (main)
This commit is contained in:
36
Jenkinsfile
vendored
Normal file
36
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
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 {
|
||||
success { echo '✅ sales 배포 완료 (' + env.BRANCH_NAME + ')' }
|
||||
failure { echo '❌ sales 배포 실패 (' + env.BRANCH_NAME + ')' }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user