pipeline { agent any 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 false -o publish/api' sh 'dotnet publish Admin -c Release -r win-x64 --self-contained false -o publish/admin' } } stage('Deploy API') { steps { sh 'rsync -av --delete --exclude="web.config" --exclude="restart.ps1" publish/api/ ${DEPLOY_API}/' } } stage('Deploy Admin') { steps { sh 'rsync -av --delete --exclude="web.config" --exclude="restart.ps1" publish/admin/ ${DEPLOY_ADMIN}/' } } stage('Restart Services') { agent { label 'windows-host' } steps { bat 'powershell.exe -ExecutionPolicy Bypass -File H:\\IIS\\bitforum-api\\restart.ps1' bat 'powershell.exe -ExecutionPolicy Bypass -File H:\\IIS\\bitforum-admin\\restart.ps1' } } } post { success { echo 'Backend 배포 성공!' } failure { echo 'Backend 배포 실패 - 로그를 확인하세요.' } } }