📝 Added README
continuous-integration/drone/push Build is passing Details

master
Alix JEUDI--LEMOINE 5 months ago
parent a78f3f9bd6
commit 4e60935a1f

@ -0,0 +1,40 @@
# 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:
```yaml
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
- `SECRET_SONAR_TOKEN`: Must be set on your project on Drone CI, you can create it here : https://codefirst.iut.uca.fr/sonar/account/security (select "User Token" type)
### 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.
Loading…
Cancel
Save