Compare commits
2 Commits
fa2657a29a
...
c3e7d4506a
| Author | SHA1 | Date | |
|---|---|---|---|
| c3e7d4506a | |||
| d77881ce43 |
32
Jenkinsfile
vendored
Normal file
32
Jenkinsfile
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
STATIC = '/var/www/manager'
|
||||
NOTIFY = "${ITSM_BASE_URL}/api/messenger/webhook"
|
||||
}
|
||||
options { buildDiscarder(logRotator(numToKeepStr: '5')); timeout(time: 15, unit: 'MINUTES') }
|
||||
stages {
|
||||
stage('Checkout') { steps { checkout scm } }
|
||||
stage('Build') {
|
||||
steps {
|
||||
dir('frontend') {
|
||||
sh 'npm ci 2>/dev/null || npm install'
|
||||
sh 'npm run build'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
when { branch 'main' }
|
||||
steps {
|
||||
sh """
|
||||
cp -r frontend/dist/. ${STATIC}/
|
||||
systemctl restart guardia-manager 2>/dev/null || true
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success { sh "curl -sf -X POST ${NOTIFY} -H 'Content-Type:application/json' -d '{\"event\":\"build_result\",\"room\":\"ops\",\"success\":true,\"result_summary\":\"✅ guardia-manager 배포 완료\"}' 2>/dev/null || true" }
|
||||
failure { sh "curl -sf -X POST ${NOTIFY} -H 'Content-Type:application/json' -d '{\"event\":\"build_result\",\"room\":\"ops\",\"success\":false,\"result_summary\":\"❌ guardia-manager 빌드 실패\"}' 2>/dev/null || true" }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user