]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] Generate and consume frontend code coverage reports
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Fri, 25 Feb 2022 14:21:46 +0000 (15:21 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 25 Feb 2022 20:02:43 +0000 (20:02 +0000)
.travis.yml
travis.sh

index 8faa6c907a4e7d6a09250360ce3a430f9339eb71..e4375e4c59586622fc8514007f30ddee9df2bf15 100644 (file)
@@ -10,10 +10,6 @@ branches:
     - /^dogfood\/.*$/
     - public_master
 
-env:
-  - TARGET=BUILD
-  - TARGET=WEB_TESTS
-
 matrix:
   fast_finish: true
 
index a5eac38793029c4731ab250f3d0144e088b975c6..263eba982caae8a384803d8b335f147df0bad090 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -32,42 +32,26 @@ keep_alive &
 # @TravisCI please provide the feature natively, like at AppVeyor or CircleCI ;-)
 cancel_branch_build_with_pr || if [[ $? -eq 1 ]]; then exit 0; fi
 
-case "$TARGET" in
-
-BUILD)
-  git fetch --unshallow
-  ./gradlew build --no-daemon --console plain
-
-  # the '-' at the end is needed when using set -u (the 'nounset' flag)
-  # see https://stackoverflow.com/a/9824943/641955
-  if [[ -n "${NEXT_TOKEN-}" ]]; then
-    if [[ "${TRAVIS_BRANCH}" == "master" ]]; then
-      ./gradlew jacocoTestReport sonarqube --info --no-daemon --console plain \
-        -Dsonar.projectKey=sonarqube \
-        -Dsonar.host.url=https://next.sonarqube.com/sonarqube \
-        -Dsonar.login="$NEXT_TOKEN"
-    else
-      ./gradlew jacocoTestReport sonarqube --info --no-daemon --console plain \
-        -Dsonar.projectKey=sonarqube \
-        -Dsonar.host.url=https://next.sonarqube.com/sonarqube \
-        -Dsonar.login="$NEXT_TOKEN" \
-        -Dsonar.branch.name="$TRAVIS_BRANCH"
-    fi
-    
-    # Wait for 5mins, hopefully the report will be processed.
-    sleep 5m
-    ./.travis/run_iris.sh
+git fetch --unshallow
+./gradlew build --no-daemon --console plain
+
+# the '-' at the end is needed when using set -u (the 'nounset' flag)
+# see https://stackoverflow.com/a/9824943/641955
+if [[ -n "${NEXT_TOKEN-}" ]]; then
+  if [[ "${TRAVIS_BRANCH}" == "master" ]]; then
+    ./gradlew jacocoTestReport :server:sonar-web:yarn_validate-ci sonarqube --info --no-daemon --console plain \
+      -Dsonar.projectKey=sonarqube \
+      -Dsonar.host.url=https://next.sonarqube.com/sonarqube \
+      -Dsonar.login="$NEXT_TOKEN"
+  else
+    ./gradlew jacocoTestReport :server:sonar-web:yarn_validate-ci sonarqube --info --no-daemon --console plain \
+      -Dsonar.projectKey=sonarqube \
+      -Dsonar.host.url=https://next.sonarqube.com/sonarqube \
+      -Dsonar.login="$NEXT_TOKEN" \
+      -Dsonar.branch.name="$TRAVIS_BRANCH"
   fi
-  ;;
-
-WEB_TESTS)
-  ./gradlew :server:sonar-web:yarn :server:sonar-web:yarn_validate --no-daemon --console plain
-  ;;
   
-*)
-  echo "Unexpected TARGET value: $TARGET"
-  exit 1
-  ;;
-
-esac
-
+  # Wait for 5mins, hopefully the report will be processed.
+  sleep 5m
+  ./.travis/run_iris.sh
+fi