]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
travis: Read project/organization for SonarCloud from environment variable
authorTobias Brunner <tobias@strongswan.org>
Fri, 4 Sep 2020 14:20:40 +0000 (16:20 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 9 Sep 2020 11:25:30 +0000 (13:25 +0200)
.travis.yml
scripts/test.sh

index 50cacc310978df4054cafd42e12734511b6b984b..41a16373827693fc697fbae4f127a73cfa06523c 100644 (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:
index af99825f8e748f56a1d009772d2c08efd76abd54..0c5cebc9b70ab0e3290024b674a1e4fd572d24fb 100755 (executable)
@@ -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 \