another sonarqube attempt

This commit is contained in:
BroodjeAap 2023-04-08 16:39:25 +00:00
parent bea4c67cd6
commit a2a2c2d5d5

View file

@ -1,12 +1,19 @@
kind: pipeline kind: pipeline
type: kubernetes type: kubernetes
name: test name: test-and-sonarqube
steps: steps:
- name: test - name: test
image: golang image: golang
commands: commands:
- go build - 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: trigger:
branch: branch:
- master - master
@ -25,23 +32,6 @@ steps:
force: true force: true
ssh_key: ssh_key:
from_secret: id_rsa 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: trigger:
branch: branch:
- master - master