Jenkinsfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. pipeline {
  2. agent any
  3. environment {
  4. DOTNET_CLI_TELEMETRY_OPTOUT = '1'
  5. DEPLOY_API = 'H:\\iis\\bitforum-api'
  6. DEPLOY_ADMIN = 'H:\\iis\\bitforum-admin'
  7. }
  8. stages {
  9. stage('Backend Build') {
  10. steps {
  11. bat 'dotnet publish Backend\\Web.Api -c Release -o publish\\api'
  12. bat 'dotnet publish Backend\\Admin -c Release -o publish\\admin'
  13. }
  14. }
  15. stage('Deploy API') {
  16. steps {
  17. bat 'powershell.exe -ExecutionPolicy Bypass -File %DEPLOY_API%\\restart.ps1 stop'
  18. bat 'timeout /t 3 /nobreak'
  19. bat 'robocopy publish\\api %DEPLOY_API% /E /PURGE /XF web.config restart.ps1 || if %ERRORLEVEL% LEQ 7 exit 0'
  20. bat 'powershell.exe -ExecutionPolicy Bypass -File %DEPLOY_API%\\restart.ps1 start'
  21. }
  22. }
  23. stage('Deploy Admin') {
  24. steps {
  25. bat 'powershell.exe -ExecutionPolicy Bypass -File %DEPLOY_ADMIN%\\restart.ps1 stop'
  26. bat 'timeout /t 3 /nobreak'
  27. bat 'robocopy publish\\admin %DEPLOY_ADMIN% /E /PURGE /XF web.config restart.ps1 || if %ERRORLEVEL% LEQ 7 exit 0'
  28. bat 'powershell.exe -ExecutionPolicy Bypass -File %DEPLOY_ADMIN%\\restart.ps1 start'
  29. }
  30. }
  31. }
  32. post {
  33. success {
  34. echo 'bitForum-backend 배포 성공!'
  35. }
  36. failure {
  37. echo 'bitforum-backend 배포 실패 - 기록을 확인하세요.'
  38. }
  39. }
  40. }