|
|
@@ -1,19 +1,16 @@
|
|
|
pipeline {
|
|
|
- agent any
|
|
|
+ agent { label 'windows-host' }
|
|
|
environment {
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT = '1'
|
|
|
- DEPLOY_API = '/mnt/h/bitforum-api/sources'
|
|
|
- DEPLOY_ADMIN = '/mnt/h/bitforum-admin/sources'
|
|
|
}
|
|
|
stages {
|
|
|
stage('Build') {
|
|
|
steps {
|
|
|
- sh 'dotnet publish Web.Api -c Release -r win-x64 --self-contained true -o publish/api'
|
|
|
- sh 'dotnet publish Admin -c Release -r win-x64 --self-contained true -o publish/admin'
|
|
|
+ bat 'dotnet publish Web.Api -c Release -o publish\\api'
|
|
|
+ bat 'dotnet publish Admin -c Release -o publish\\admin'
|
|
|
}
|
|
|
}
|
|
|
- stage('Stop Services') {
|
|
|
- agent { label 'windows-host' }
|
|
|
+ stage('Stop Services') {
|
|
|
steps {
|
|
|
bat 'sc.exe stop bitforum-Api || exit 0'
|
|
|
bat 'sc.exe stop bitforum-Admin || exit 0'
|
|
|
@@ -22,16 +19,15 @@ pipeline {
|
|
|
}
|
|
|
stage('Deploy API') {
|
|
|
steps {
|
|
|
- sh 'rsync -av --delete --exclude="web.config" --exclude="restart.ps1" publish/api/ ${DEPLOY_API}/'
|
|
|
+ bat 'robocopy publish\\api H:\\IIS\\bitforum-api\\sources /E /PURGE /XF web.config restart.ps1 & if %ERRORLEVEL% LEQ 7 exit 0'
|
|
|
}
|
|
|
}
|
|
|
stage('Deploy Admin') {
|
|
|
steps {
|
|
|
- sh 'rsync -av --delete --exclude="web.config" --exclude="restart.ps1" publish/admin/ ${DEPLOY_ADMIN}/'
|
|
|
+ bat 'robocopy publish\\admin H:\\IIS\\bitforum-admin\\sources /E /PURGE /XF web.config restart.ps1 & if %ERRORLEVEL% LEQ 7 exit 0'
|
|
|
}
|
|
|
}
|
|
|
stage('Start Services') {
|
|
|
- agent { label 'windows-host' }
|
|
|
steps {
|
|
|
bat 'sc.exe start bitforum-Api'
|
|
|
bat 'sc.exe start bitforum-Admin'
|
|
|
@@ -40,6 +36,6 @@ pipeline {
|
|
|
}
|
|
|
post {
|
|
|
success { echo 'Backend 배포 성공!' }
|
|
|
- failure { echo 'Backend 배포 실패 - 로그를 확인하세요.' }
|
|
|
+ failure { echo 'Backend 배포 실패!' }
|
|
|
}
|
|
|
-}
|
|
|
+}
|