Ver código fonte

Update 'Jenkinsfile'

관리자 2 meses atrás
pai
commit
8e0d2712b0
1 arquivos alterados com 9 adições e 14 exclusões
  1. 9 14
      Jenkinsfile

+ 9 - 14
Jenkinsfile

@@ -2,41 +2,36 @@ pipeline {
     agent { label 'windows-host' }
     agent { label 'windows-host' }
     environment {
     environment {
         DOTNET_CLI_TELEMETRY_OPTOUT = '1'
         DOTNET_CLI_TELEMETRY_OPTOUT = '1'
-		JAVA_TOOL_OPTIONS = '-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8'
+        JAVA_TOOL_OPTIONS = '-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8'
     }
     }
     stages {
     stages {
-        stage('Checkout') {
-            steps {
-                checkout scm
-            }
-        }
         stage('Build') {
         stage('Build') {
             steps {
             steps {
-                bat 'dotnet publish Web.Api -c Release -r win-x64 -o publish\\api'
-                bat 'dotnet publish Admin -c Release -r win-x64 -o publish\\admin'
+                bat 'chcp 65001 && dotnet publish Web.Api -c Release -r win-x64 -o publish\\api'
+                bat 'chcp 65001 && dotnet publish Admin -c Release -r win-x64 -o publish\\admin'
             }
             }
         }
         }
         stage('Stop Services') {
         stage('Stop Services') {
             steps {
             steps {
-                bat 'sc.exe stop bitforum-Api || exit 0'
-                bat 'sc.exe stop bitforum-Admin || exit 0'
+                bat 'chcp 65001 && sc.exe stop bitforum-Api || exit 0'
+                bat 'chcp 65001 && sc.exe stop bitforum-Admin || exit 0'
                 bat 'ping 127.0.0.1 -n 6 > nul'
                 bat 'ping 127.0.0.1 -n 6 > nul'
             }
             }
         }
         }
         stage('Deploy API') {
         stage('Deploy API') {
             steps {
             steps {
-                bat 'robocopy publish\\api H:\\IIS\\bitforum-api\\sources /MIR /XF web.config restart.ps1 /NFL /NDL /NP & if %ERRORLEVEL% LEQ 7 exit /b 0'
+                bat 'chcp 65001 && robocopy publish\\api H:\\IIS\\bitforum-api\\sources /MIR /XF web.config restart.ps1 /NFL /NDL /NP & if %ERRORLEVEL% LEQ 7 exit /b 0'
             }
             }
         }
         }
         stage('Deploy Admin') {
         stage('Deploy Admin') {
             steps {
             steps {
-                bat 'robocopy publish\\admin H:\\IIS\\bitforum-admin\\sources /MIR /XF web.config restart.ps1 /NFL /NDL /NP & if %ERRORLEVEL% LEQ 7 exit /b 0'
+                bat 'chcp 65001 && robocopy publish\\admin H:\\IIS\\bitforum-admin\\sources /MIR /XF web.config restart.ps1 /NFL /NDL /NP & if %ERRORLEVEL% LEQ 7 exit /b 0'
             }
             }
         }
         }
         stage('Start Services') {
         stage('Start Services') {
             steps {
             steps {
-                bat 'sc.exe start bitforum-Api'
-                bat 'sc.exe start bitforum-Admin'
+                bat 'chcp 65001 && sc.exe start bitforum-Api'
+                bat 'chcp 65001 && sc.exe start bitforum-Admin'
             }
             }
         }
         }
     }
     }