diff --git a/.drone.yml b/.drone.yml index 741c4e8..c849525 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,9 +5,17 @@ type: docker steps: - name: code-analysis pull: if-not-exists - image: sonarsource/sonar-scanner-cli + image: mcr.microsoft.com/dotnet/sdk:6.0 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: SONAR_HOST: from_secret: sonar_host @@ -16,6 +24,7 @@ steps: SONAR_PROJECT_KEY: from_secret: sonar_project_key + trigger: event: - push