基于Jenkins Pipeline的ASP.NET Core持续集成实践(3)

pipeline{ agent any stages { stage('XDP Core Services Checkout') { steps{ checkout([$class: 'GitSCM', branches: [[name: '*/dev-xds']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '35b9890b-2338-45e2-8a1a-78e9bbe1d3e2', url: 'http://192.168.18.150:3000/EDC.ITC.XDP.Core/EDC.XDP.Core.git']]]) echo 'Core Services Checkout Done' } } stage('XDP Core Services Build') { steps{ bat '''cd "D:\\Jenkins\\workspace\\XDS.Dev.CI.Pipeline\\src\\services\\EDC.XDP.Core\\" dotnet build EDC.XDP.Core-All.sln''' echo 'Core Services Build Done' } } stage('Core Delivery Service Unit Test') { steps{ bat '''cd "D:\\Jenkins\\workspace\\XDS.Dev.CI.Pipeline\\src\\services\\EDC.XDP.Core\\Services\\EDC.XDP.Core.Delivery.UnitTest" dotnet test -v n --no-build EDC.XDP.Core.Delivery.UnitTest.csproj''' echo 'Core Delivery Service Unit Test Done' } } stage('XDS Delivery Service Checkout') { steps{ checkout([$class: 'GitSCM', branches: [[name: '*/dev-service']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '35b9890b-2338-45e2-8a1a-78e9bbe1d3e2', url: 'http://192.168.18.150:3000/EDC.ITC.XDP.XDS/EDC.XDP.XDS.git']]]) echo 'Core Delivery Service Checkout Done' } } stage('XDS Delivery Service Build') { steps{ bat '''cd "D:\\Jenkins\\workspace\\XDS.Dev.CI.Pipeline\\src\\services\\EDC.XDP.XDS" dotnet build EDC.XDP.XDS.sln''' echo 'XDS Service Build Done' } } stage('XDS Delivery Service Unit Test') { steps{ bat '''cd "D:\\Jenkins\\workspace\\XDS.Dev.CI.Pipeline\\src\\services\\EDC.XDP.XDS\\EDC.XDP.XDS.Delivery.UnitTest" dotnet test -v n --no-build EDC.XDP.XDS.Delivery.UnitTest.csproj''' echo 'XDS Service Unit Test Done' } } } post{ failure { emailext ( subject: '${DEFAULT_SUBJECT}', body: '${DEFAULT_CONTENT}', to: "edisonchou@qq.com,xxxxx@qq.com") } } }

View Code

  (2)持续发布Pipeline

  持续发布Pipeline与持续集成Pipeline类似,只是在脚本处有所不同:

基于Jenkins Pipeline的ASP.NET Core持续集成实践

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7066499d464af64905becc367c1b5987.html