Created
February 13, 2022 22:22
-
-
Save majorsilence/911583d86c90d88bef9135750531a12d to your computer and use it in GitHub Desktop.
Dotnet Jenkins Pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent none | |
| environment { | |
| DOTNET_CLI_HOME = "/tmp/DOTNET_CLI_HOME" | |
| } | |
| stages { | |
| stage('build and test') { | |
| agent { | |
| docker { | |
| image 'mcr.microsoft.com/dotnet/sdk:6.0' | |
| } | |
| } | |
| steps { | |
| echo "building" | |
| sh """ | |
| dotnet restore [YourSolution].sln | |
| dotnet build [YourSolution].sln --no-restore | |
| dotnet vstest [YourSolution].sln --logger:"nunit;LogFileName=build/nunit-results.xml" | |
| """ | |
| } | |
| post{ | |
| always { | |
| nunit testResultsPattern: 'build/nunit-results.xml' | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment