|
|
|
@ -35,14 +35,38 @@ steps:
|
|
|
|
|
commands:
|
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
|
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
|
|
|
|
|
|
|
|
|
|
# Début de l'analyse Sonar
|
|
|
|
|
- dotnet sonarscanner begin /k:$${project_key} \
|
|
|
|
|
/d:sonar.host.url=$${sonar_host} \
|
|
|
|
|
/d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" \
|
|
|
|
|
/d:sonar.coverage.exclusions=$${coverage_exclusions} \
|
|
|
|
|
/d:sonar.login=$${sonar_token}
|
|
|
|
|
|
|
|
|
|
# Build
|
|
|
|
|
- dotnet build WF-WebAdmin.csproj -c Release --no-restore
|
|
|
|
|
- dotnet test WF-WebAdmin.csproj --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
|
|
|
|
|
|
|
|
|
# Test + Collecte de la couverture en format Cobertura
|
|
|
|
|
- dotnet test WF-WebAdmin.csproj --logger trx --no-restore \
|
|
|
|
|
/p:CollectCoverage=true \
|
|
|
|
|
/p:CoverletOutput=coveragereport/coverage.cobertura.xml \
|
|
|
|
|
/p:CoverletOutputFormat=cobertura
|
|
|
|
|
|
|
|
|
|
# Vérifier la présence du fichier de couverture
|
|
|
|
|
- ls -R
|
|
|
|
|
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
|
|
|
|
|
|
|
|
|
# Générer le rapport SonarQube
|
|
|
|
|
- reportgenerator -reports:"coveragereport/coverage.cobertura.xml" \
|
|
|
|
|
-reporttypes:SonarQube \
|
|
|
|
|
-targetdir:"coveragereport"
|
|
|
|
|
|
|
|
|
|
# (Optionnel) Publish si besoin
|
|
|
|
|
- dotnet publish WF-WebAdmin.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/publish
|
|
|
|
|
|
|
|
|
|
# Fin de l’analyse Sonar
|
|
|
|
|
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: docker_build
|
|
|
|
|
image: plugins/docker
|
|
|
|
|
settings:
|
|
|
|
|