|
|
@@ -2,41 +2,36 @@ pipeline {
|
|
|
agent { label 'windows-host' }
|
|
|
environment {
|
|
|
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 {
|
|
|
- stage('Checkout') {
|
|
|
- steps {
|
|
|
- checkout scm
|
|
|
- }
|
|
|
- }
|
|
|
stage('Build') {
|
|
|
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') {
|
|
|
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'
|
|
|
}
|
|
|
}
|
|
|
stage('Deploy API') {
|
|
|
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') {
|
|
|
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') {
|
|
|
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'
|
|
|
}
|
|
|
}
|
|
|
}
|