Jenkinsfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. pipeline {
  2. agent any
  3. environment {
  4. DOTNET_CLI_TELEMETRY_OPTOUT = '1'
  5. DEPLOY_API = '/mnt/h/iis/bitforum-api'
  6. DEPLOY_ADMIN = '/mnt/h/iis/bitforum-admin'
  7. }
  8. stages {
  9. stage('Build') {
  10. steps {
  11. sh 'dotnet publish Backend/Web.Api -c Release -o publish/api'
  12. sh 'dotnet publish Backend/Admin -c Release -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. steps {
  27. sh 'powershell.exe -ExecutionPolicy Bypass -File /mnt/h/iis/bitforum-api/restart.ps1'
  28. sh 'powershell.exe -ExecutionPolicy Bypass -File /mnt/h/iis/bitforum-admin/restart.ps1'
  29. }
  30. }
  31. }
  32. post {
  33. success { echo 'Backend 배포 성공!' }
  34. failure { echo 'Backend 배포 실패 - 로그를 확인하세요.' }
  35. }
  36. }