|
|
|
@ -21,7 +21,7 @@ steps:
|
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
|
- dotnet test WF-WebAdmin.csproj --no-restore
|
|
|
|
|
depends_on: [build]
|
|
|
|
|
depends_on: [ build ]
|
|
|
|
|
|
|
|
|
|
- name: code-inspection
|
|
|
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
|
|
|
@ -30,48 +30,42 @@ steps:
|
|
|
|
|
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
|
|
|
|
sonar_token:
|
|
|
|
|
from_secret: sonar_token
|
|
|
|
|
project_key: S201
|
|
|
|
|
project_key: WF-WebAdmin
|
|
|
|
|
coverage_exclusions: 'UnitTesting/**'
|
|
|
|
|
commands:
|
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
# SonarScanner (en une seule ligne pour éviter les soucis d'arguments)
|
|
|
|
|
- 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}
|
|
|
|
|
|
|
|
|
|
- dotnet build WF-WebAdmin.csproj -c Release --no-restore
|
|
|
|
|
|
|
|
|
|
# Test + Collecte de la couverture en format Cobertura
|
|
|
|
|
|
|
|
|
|
# Exécution des tests + Coverlet => fichier Cobertura (coverage.cobertura.xml)
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
|
|
# Vérification du contenu
|
|
|
|
|
- ls -R
|
|
|
|
|
|
|
|
|
|
# Générer le rapport SonarQube
|
|
|
|
|
- reportgenerator -reports:"coveragereport/coverage.cobertura.xml" \
|
|
|
|
|
-reporttypes:SonarQube \
|
|
|
|
|
-targetdir:"coveragereport"
|
|
|
|
|
|
|
|
|
|
# (Optionnel) Publish si besoin
|
|
|
|
|
|
|
|
|
|
# Génération du rapport SonarQube depuis Cobertura
|
|
|
|
|
- reportgenerator -reports:"coveragereport/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
|
|
|
|
|
|
|
|
|
# (Optionnel) Publication si besoin
|
|
|
|
|
- dotnet publish WF-WebAdmin.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/publish
|
|
|
|
|
|
|
|
|
|
# Fin de l’analyse Sonar
|
|
|
|
|
|
|
|
|
|
# Clôture de l'analyse Sonar
|
|
|
|
|
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
|
|
|
|
|
|
|
|
|
|
depends_on: [ build, tests ]
|
|
|
|
|
|
|
|
|
|
- name: docker_build
|
|
|
|
|
image: plugins/docker
|
|
|
|
|
image: plugins/docker
|
|
|
|
|
settings:
|
|
|
|
|
repo: hub.codefirst.iut.uca.fr/whatthefantasy/wf-webadmin
|
|
|
|
|
registry: hub.codefirst.iut.uca.fr
|
|
|
|
|
registry: hub.codefirst.iut.uca.fr
|
|
|
|
|
dockerfile: Docker/Dockerfile
|
|
|
|
|
tags:
|
|
|
|
|
- latest
|
|
|
|
@ -79,4 +73,4 @@ steps:
|
|
|
|
|
from_secret: docker_username
|
|
|
|
|
password:
|
|
|
|
|
from_secret: docker_password
|
|
|
|
|
depends_on: [build, tests, code-inspection]
|
|
|
|
|
depends_on: [ build, tests, code-inspection ]
|
|
|
|
|