]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
github: Fail sonarcloud test if required environment variables aren't set
authorNoel Kuntze <noel.kuntze@thermi.consulting>
Sat, 17 Apr 2021 05:22:39 +0000 (07:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 5 May 2021 16:10:03 +0000 (18:10 +0200)
Closes strongswan/strongswan#330.

scripts/test.sh

index 92d3f18d87175f89c686be91aa38c99c99315ca6..97f1a352dbf606492e625f3971261dc888882c96 100755 (executable)
@@ -144,6 +144,13 @@ printf-builtin)
        CONFIG="--with-printf-hooks=builtin"
        ;;
 all|coverage|sonarcloud)
+       if [ "$TEST" = "sonarcloud" ]; then
+               if [ -z "$SONAR_PROJECT" -o -z "$SONAR_ORGANIZATION" -o -z "$SONAR_TOKEN" ]; then
+                       echo "The SONAR_PROJECT, SONAR_ORGANIZATION and SONAR_TOKEN" \
+                                "environment variables are required to run this test"
+                       exit 1
+               fi
+       fi
        CONFIG="--enable-all --disable-android-dns --disable-android-log
                        --disable-kernel-pfroute --disable-keychain
                        --disable-lock-profiler --disable-padlock --disable-fuzzing