| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- pipeline {
- agent { label 'windows-host' }
- environment {
- DOTNET_CLI_TELEMETRY_OPTOUT = '1'
- }
- stages {
- stage('Build') {
- steps {
- bat 'dotnet publish Web.Api -c Release -o publish\\api'
- bat 'dotnet publish Admin -c Release -o publish\\admin'
- }
- }
- stage('Stop Services') {
- steps {
- bat 'sc.exe stop bitforum-Api || exit 0'
- bat 'sc.exe stop bitforum-Admin || exit 0'
- bat 'ping 127.0.0.1 -n 6 > nul'
- }
- }
- stage('Deploy API') {
- steps {
- 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 {
- 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') {
- steps {
- bat 'sc.exe start bitforum-Api'
- bat 'sc.exe start bitforum-Admin'
- }
- }
- }
- post {
- success { echo 'Backend 배포 성공!' }
- failure { echo 'Backend 배포 실패!' }
- }
- }
|