Jenkinsfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. pipeline {
  2. agent any
  3. environment {
  4. DOTNET_CLI_TELEMETRY_OPTOUT = '1'
  5. DEPLOY_API = '/mnt/h/bitforum-api/sources'
  6. DEPLOY_ADMIN = '/mnt/h/bitforum-admin/sources'
  7. }
  8. stages {
  9. stage('Build') {
  10. steps {
  11. sh 'dotnet publish Web.Api -c Release -r win-x64 --self-contained true -o publish/api'
  12. sh 'dotnet publish Admin -c Release -r win-x64 --self-contained true -o publish/admin'
  13. }
  14. }
  15. stage('Deploy API') {
  16. steps {
  17. sh 'rsync -av --delete --exclude="web.config" --exclude="restart.ps1" publish/api/ ${DEPLOY_API}/'
  18. }
  19. }
  20. stage('Deploy Admin') {
  21. steps {
  22. sh 'rsync -av --delete --exclude="web.config" --exclude="restart.ps1" publish/admin/ ${DEPLOY_ADMIN}/'
  23. }
  24. }
  25. stage('Restart Services') {
  26. agent { label 'windows-host' }
  27. steps {
  28. bat 'powershell.exe -ExecutionPolicy Bypass -File H:\\IIS\\bitforum-api\\restart.ps1'
  29. bat 'powershell.exe -ExecutionPolicy Bypass -File H:\\IIS\\bitforum-admin\\restart.ps1'
  30. }
  31. }
  32. }
  33. post {
  34. success { echo 'Backend 배포 성공!' }
  35. failure { echo 'Backend 배포 실패 - 로그를 확인하세요.' }
  36. }
  37. }