Add Sonar scan
This commit is contained in:
+12
-2
@@ -1,6 +1,7 @@
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- analysis
|
||||
- deploy
|
||||
|
||||
before_script:
|
||||
@@ -24,12 +25,21 @@ Test Go Application:
|
||||
stage: test
|
||||
script:
|
||||
- make test
|
||||
- GOPATH=$HOME/go go test -v ./... 2>&1 | /home/gitlab-runner/go/bin/go-junit-report > report.xml
|
||||
- GOPATH=$HOME/go go vet ./...
|
||||
- go test -v ./... 2>&1 | /home/gitlab-runner/go/bin/go-junit-report > report.xml
|
||||
- go vet ./...
|
||||
artifacts:
|
||||
reports:
|
||||
junit: report.xml
|
||||
|
||||
Code analysis:
|
||||
stage: analysis
|
||||
script:
|
||||
- go test -json ./... > test-report.out
|
||||
- go test -coverprofile=coverage.out ./...
|
||||
- /home/gitlab-runner/go/bin/golint ./... > golint-report.out
|
||||
- go vet ./... 2> govet-report.out
|
||||
- /data/sonar-scanner/bin/sonar-scanner -Dsonar.projectVersion=$(git describe --abbrev=0) -Dsonar.host.url=https://sonar.ingenieurbuero-peetz.de -Dsonar.login=ed0634e05811fb2b1cdd0f16b0a924f943623520
|
||||
|
||||
Deploy To Staging:
|
||||
stage: deploy
|
||||
script:
|
||||
|
||||
Reference in New Issue
Block a user