Update .drone.yml

This commit is contained in:
Victor Mylle
2023-03-08 10:12:05 +00:00
parent 7ed5a959e2
commit 38e3f94b6e

View File

@@ -5,9 +5,17 @@ type: docker
steps: steps:
- name: code-analysis - name: code-analysis
pull: if-not-exists pull: if-not-exists
image: sonarsource/sonar-scanner-cli image: mcr.microsoft.com/dotnet/sdk:6.0
commands: commands:
- sonar-scanner -Dsonar.host.url=$SONAR_HOST -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.projectVersion=$DRONE_REPO_BRANCH-$DRONE_COMMIT-$DRONE_COMMIT_AUTHOR -Dsonar.qualitygate.wait=true - apt-get update && apt-get install -y unzip
- curl -LsS https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/5.3.1.35617/sonar-scanner-msbuild-5.3.1.35617-netcoreapp2.0.zip -o sonar-scanner.zip
- unzip sonar-scanner.zip -d /usr/local/sonar-scanner
- rm sonar-scanner.zip
- export PATH="/usr/local/sonar-scanner/sonar-scanner-4.6.2.2472-linux/bin:$PATH"
- dotnet tool install --global dotnet-sonarscanner
- dotnet sonarscanner begin /k:"$SONAR_PROJECT_KEY" /d:sonar.host.url="$SONAR_HOST" /d:sonar.login="$SONAR_TOKEN" /d:sonar.branch.name="$DRONE_REPO_BRANCH" /d:sonar.analysis.mode=preview
- dotnet build
- dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN"
environment: environment:
SONAR_HOST: SONAR_HOST:
from_secret: sonar_host from_secret: sonar_host
@@ -16,6 +24,7 @@ steps:
SONAR_PROJECT_KEY: SONAR_PROJECT_KEY:
from_secret: sonar_project_key from_secret: sonar_project_key
trigger: trigger:
event: event:
- push - push