From: Tobias Brunner Date: Fri, 4 Sep 2020 14:20:40 +0000 (+0200) Subject: travis: Read project/organization for SonarCloud from environment variable X-Git-Tag: 5.9.1dr1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd5cf311088b03535c746a7e71d80890f8dbaa05;p=thirdparty%2Fstrongswan.git travis: Read project/organization for SonarCloud from environment variable --- diff --git a/.travis.yml b/.travis.yml index 50cacc3109..41a1637382 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 af99825f8e..0c5cebc9b7 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 \