Jenkinsfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. pipeline {
  2. agent { label 'windows-host' }
  3. environment {
  4. DOTNET_CLI_TELEMETRY_OPTOUT = '1'
  5. }
  6. stages {
  7. stage('Build') {
  8. steps {
  9. bat 'dotnet publish Web.Api -c Release -o publish\\api'
  10. bat 'dotnet publish Admin -c Release -o publish\\admin'
  11. }
  12. }
  13. stage('Stop Services') {
  14. steps {
  15. bat 'sc.exe stop bitforum-Api || exit 0'
  16. bat 'sc.exe stop bitforum-Admin || exit 0'
  17. bat 'ping 127.0.0.1 -n 6 > nul'
  18. }
  19. }
  20. stage('Deploy API') {
  21. steps {
  22. bat 'robocopy publish\\api H:\\IIS\\bitforum-api\\sources /E /PURGE /XF web.config restart.ps1 & if %ERRORLEVEL% LEQ 7 exit 0'
  23. }
  24. }
  25. stage('Deploy Admin') {
  26. steps {
  27. bat 'robocopy publish\\admin H:\\IIS\\bitforum-admin\\sources /E /PURGE /XF web.config restart.ps1 & if %ERRORLEVEL% LEQ 7 exit 0'
  28. }
  29. }
  30. stage('Start Services') {
  31. steps {
  32. bat 'sc.exe start bitforum-Api'
  33. bat 'sc.exe start bitforum-Admin'
  34. }
  35. }
  36. }
  37. post {
  38. success { echo 'Backend 배포 성공!' }
  39. failure { echo 'Backend 배포 실패!' }
  40. }
  41. }