Image pour faire du code-analysis avec sonar sur codefirst en .NET 8 (sans MAUI)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Hugo LIVET 428abd3a6d
continuous-integration/drone/push Build is passing Details
Mise à jour de 'README.md'
6 months ago
.drone.yml Mise à jour de '.drone.yml' 6 months ago
.gitignore Initial commit 6 months ago
Dockerfile Mise à jour de 'Dockerfile' 6 months ago
README.md Mise à jour de 'README.md' 6 months ago

README.md

codefirst-dronesonarplugin-dotnet8

Cette image Docker est fournie pour être utilisé sur Codefirst et inclut les outils nécessaires pour intégrer l'analyse et la génération de rapports SonarQube dans les projets .NET 8 en utilisant Drone CI.

Détails de l'image

  • Image de base : mcr.microsoft.com/dotnet/sdk:8.0-alpine
  • Outils supplémentaires :
    • OpenJDK 17 (JRE)
    • Node.js
    • dotnet-sonarscanner
    • dotnet-reportgenerator-globaltool

Utilisation

Pour utiliser cette image dans votre pipeline Drone CI, vous pouvez la référencer dans votre fichier .drone.yml :

- name: code-analysis
      image: hub.codefirst.iut.uca.fr/hugo.livet/codefirst-dronesonarplugin-dotnet8
      commands:
        - cd votre_path/
        - dotnet restore Votre_sln.sln
        - dotnet sonarscanner begin /k:VotreKey /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} 
        - dotnet build Votre_sln.sln -c Release --no-restore
        - dotnet test Votre_sln.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
        - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
        - dotnet publish Votre_sln.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
        - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
      secrets: [ SECRET_SONAR_LOGIN ]
      settings:
        sonar_host: https://codefirst.iut.uca.fr/sonar/
        sonar_token:
          from_secret: SECRET_SONAR_LOGIN
      depends_on: [tests]