You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

travis.sh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. ./.travis/setup_ramdisk.sh
  4. #
  5. # Configure Maven settings and install some script utilities
  6. #
  7. configureTravis() {
  8. mkdir -p ~/.local
  9. curl -sSL https://github.com/SonarSource/travis-utils/tarball/v50 | tar zx --strip-components 1 -C ~/.local
  10. source ~/.local/bin/install
  11. }
  12. configureTravis
  13. #
  14. # Travis fails on timeout when build does not print logs
  15. # during 10 minutes. This aims to bypass this
  16. # behavior when building the slow sonar-server sub-project.
  17. #
  18. keep_alive() {
  19. while true; do
  20. echo -en "\a"
  21. sleep 60
  22. done
  23. }
  24. keep_alive &
  25. # When a pull request is open on the branch, then the job related
  26. # to the branch does not need to be executed and should be canceled.
  27. # It does not book slaves for nothing.
  28. # @TravisCI please provide the feature natively, like at AppVeyor or CircleCI ;-)
  29. cancel_branch_build_with_pr || if [[ $? -eq 1 ]]; then exit 0; fi
  30. case "$TARGET" in
  31. BUILD)
  32. git fetch --unshallow
  33. ./gradlew build sonarqube --no-daemon --console plain \
  34. -PjacocoEnabled=true \
  35. -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \
  36. -Dsonar.organization=sonarsource \
  37. -Dsonar.host.url=https://sonarcloud.io \
  38. -Dsonar.login=$SONAR_TOKEN
  39. ;;
  40. WEB_TESTS)
  41. ./gradlew :server:sonar-web:yarn :server:sonar-web:yarn_validate --no-daemon --console plain
  42. ./gradlew :server:sonar-vsts:yarn :server:sonar-vsts:yarn_validate --no-daemon --console plain
  43. ;;
  44. *)
  45. echo "Unexpected TARGET value: $TARGET"
  46. exit 1
  47. ;;
  48. esac