diff --git a/.travis.yml b/.travis.yml index 50cacc310..41a163738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/scripts/test.sh b/scripts/test.sh index af99825f8..0c5cebc9b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -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 \