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.

1.4 KiB

Code Analysis Docker Image

This Docker image is designed for code analysis using SonarQube on CodeFirst. It includes Python 3.12 and the SonarQube scanner.

Prerequisites

  • Access to Drone CI
  • SonarQube token

Usage

Example Configuration

Here is an example configuration for using this Docker image in a CI pipeline:

steps:
  - name: code-analysis
    image: hub.codefirst.iut.uca.fr/alix.jeudi--lemoine/codefirst-dronesonarplugin-python312
    commands:
    # - Generate the report here
      - /opt/sonar-scanner/bin/sonar-scanner -Dsonar.login=$PLUGIN_SONAR_TOKEN -Dsonar.projectKey=YOUR_PROJECT_KEY -Dsonar.host.url=$PLUGIN_SONAR_HOST -Dsonar.coverageReportPaths="coveragereport/SonarQube.xml" -Dsonar.coverage.exclusions="tests/**" -Dsonar.python.version=3
    settings: 
      sonar_host: https://codefirst.iut.uca.fr/sonar/
      sonar_token:
        from_secret: SECRET_SONAR_TOKEN

Drone Secret

Environment Variables

  • PLUGIN_SONAR_TOKEN: Automaticaly set by Drone (sonar_token => PLUGIN_SONAR_TOKEN / xxx => PLUGIN_XXX).

Notes

  • Ensure that the SonarQube server URL and project key are correctly set.
  • The Docker image includes the necessary dependencies for running the SonarQube scanner.