Skip to content

Commit

Permalink
updated to dotnet-2.1.401-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Alexandre committed Sep 3, 2018
1 parent acc3314 commit 9dbab2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM microsoft/dotnet:2.1-sdk
FROM microsoft/dotnet:2.1.401-sdk

ENV SONAR_SCANNER_MSBUILD_VERSION 4.3.1.1372
ENV DOCKER_VERSION 17.06.2
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It also allows you to run Docker in Docker using a docker.sock mount.

This image was built with the following components:

* dotnet-sdk-2.1 (stretch)
* dotnet-sdk-2.1.401 (stretch)
* SonarQube MSBuild Scanner 4.3.1.1372
* OpenJDK Java 8 (required for Sonar Scanner)
* Docker binaries 17.06.2 (for running Docker in Docker using the docker.sock mount)
Expand All @@ -15,6 +15,7 @@ This image was built with the following components:

Tags are written using the following pattern: `dotnet-sonar:<year>.<month>.<revision>`

* dotnet-sonar:18.09.0
* dotnet-sonar:18.07.0
* dotnet-sonar:18.03.1
* dotnet-sonar:18.03.0
Expand Down Expand Up @@ -64,7 +65,7 @@ The following pipeline code will:

* Start a sonar scanning session
* Build dotnet projects
* Run tests and publish them using the Jenkins XUnit publisher
* Run tests with coverage analysis and publish them using the Jenkins XUnit publisher
* End a sonar scanning session
* [OPTIONAL] In the end, it waits for sonar's quality gate status and sets the build outcome

Expand All @@ -75,10 +76,10 @@ node('somenode-with-docker') {
withEnv(['HOME=/tmp/home','DOTNET_CLI_TELEMETRY_OPTOUT=1']) {
stage('build') {
checkout scm
sh "dotnet /sonar-scanner/SonarScanner.MSBuild.dll begin /k:someKey /name:someName /version:someVersion"
sh "dotnet /sonar-scanner/SonarScanner.MSBuild.dll begin /k:someKey /name:someName /version:someVersion /d:sonar.cs.opencover.reportsPaths='tests/**/coverage.opencover.xml'"
sh "dotnet build -c Release /property:Version=someVersion"
sh "rm -drf ${env.WORKSPACE}/testResults"
sh (returnStatus: true, script: "find tests/**/* -name \'*.csproj\' -print0 | xargs -L1 -0 -P 8 dotnet test --no-build -c Release --logger trx --results-directory ${env.WORKSPACE}/testResults")
sh (returnStatus: true, script: "find tests/**/* -name \'*.csproj\' -print0 | xargs -L1 -0 -P 8 dotnet test --no-build -c Release --logger trx --results-directory ${env.WORKSPACE}/testResults /p:CollectCoverage=true /p:CoverletOutputFormat=opencover")
step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, thresholds: [[$class: 'FailedThreshold', unstableThreshold: '0']
, [$class: 'SkippedThreshold']], tools: [[$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: false
, pattern: 'testResults/**/*.trx', skipNoTestFiles: true, stopProcessingIfError: true]]])
Expand Down Expand Up @@ -119,7 +120,5 @@ The above code will:

## Code Coverage

if you want to add code coverage to your analyses please follow this great instructions

https://medium.com/@equiman/net-core-unit-test-and-code-coverage-with-visual-studio-code-1a384b462c5f

The above examples already implement the code-coverage analysis.
If you want to know more, check: <https://medium.com/@equiman/net-core-unit-test-and-code-coverage-with-visual-studio-code-1a384b462c5f>.

0 comments on commit 9dbab2c

Please sign in to comment.