From a2a2c2d5d55d08189c5c741a41ddf21d81f06bcd Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Sat, 8 Apr 2023 16:39:25 +0000 Subject: [PATCH] another sonarqube attempt --- .drone.yaml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.drone.yaml b/.drone.yaml index 55b0e15..5c0bd31 100644 --- a/.drone.yaml +++ b/.drone.yaml @@ -1,12 +1,19 @@ kind: pipeline type: kubernetes -name: test +name: test-and-sonarqube steps: - name: test image: golang commands: - go build - - go test -v github.com/broodjeaap/go-watch/web + - go test -v github.com/broodjeaap/go-watch/web -coverprofile=bin/cov.out + - name: sonarqube + image: sonarsource/sonar-scanner-cli + environment: + SONAR_HOST_URL: https://sonarqube.broodjeaap.net + SONAR_SCANNER_OPTS: -Dsonar.projectKey=go-watch -Dsonar.projectBaseDir=/drone/src/.git/ -Dsonar.sources=. -Dsonar.exclusions=**/*_test.go -Dsonar.tests=. -Dsonar.test.inclusions=**/*_test.go -Dsonar.go.coverage.reportPaths=bin/cov.out + SONAR_LOGIN: + from_secret: sonarqube_token trigger: branch: - master @@ -25,23 +32,6 @@ steps: force: true ssh_key: from_secret: id_rsa -trigger: - branch: - - master - event: - - push ---- -kind: pipeline -type: kubernetes -name: sonarqube -steps: -- name: sonar scanner - image: sonarsource/sonar-scanner-cli - environment: - SONAR_HOST_URL: https://sonarqube.broodjeaap.net - SONAR_SCANNER_OPTS: -Dsonar.projectKey=go-watch -Dsonar.projectBaseDir=/drone/src/.git/ - SONAR_LOGIN: - from_secret: sonarqube_token trigger: branch: - master