travis: Read project/organization for SonarCloud from environment variable

This commit is contained in:
Tobias Brunner
2020-09-09 13:25:30 +02:00
parent 76425800c4
commit fd5cf31108
2 changed files with 7 additions and 4 deletions
+5 -3
View File
@@ -39,15 +39,17 @@ env:
jobs:
include:
- env: TEST=sonarcloud
if: type = push AND env(SONAR_TOKEN) IS present
if: |
type = push AND env(SONAR_TOKEN) IS present AND \
env(SONAR_PROJECT) IS present AND \
env(SONAR_ORGANIZATION) IS present
git:
depth: false
cache:
directories:
- $HOME/.sonar-cache
addons:
sonarcloud:
organization: "strongswan"
sonarcloud: true
- env: TEST=lgtm
if: type = push AND env(LGTM_TOKEN) IS present
git:
+2 -1
View File
@@ -448,7 +448,8 @@ apidoc)
;;
sonarcloud)
sonar-scanner \
-Dsonar.projectKey=strongswan \
-Dsonar.projectKey=${SONAR_PROJECT} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
-Dsonar.projectVersion=$(git describe)+${TRAVIS_BUILD_NUMBER} \
-Dsonar.sources=. \
-Dsonar.cfamily.threads=2 \