Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

travis.sh 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. ./.travis/setup_ramdisk.sh
  4. #
  5. # A (too) old version of JDK8 is installed by default on Travis.
  6. # This method is preferred over Travis apt oracle-java8-installer because
  7. # JDK is kept in cache. It does not need to be downloaded from Oracle
  8. # at each build.
  9. #
  10. installJdk8() {
  11. echo "Setup JDK 1.8u171"
  12. mkdir -p ~/jvm
  13. pushd ~/jvm > /dev/null
  14. if [ ! -d "jdk1.8.0_171" ]; then
  15. wget --quiet --continue --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz
  16. tar xzf jdk-8u171-linux-x64.tar.gz
  17. rm jdk-8u171-linux-x64.tar.gz
  18. fi
  19. popd > /dev/null
  20. export JAVA_HOME=~/jvm/jdk1.8.0_171
  21. export PATH=$JAVA_HOME/bin:$PATH
  22. }
  23. #
  24. # Configure Maven settings and install some script utilities
  25. #
  26. configureTravis() {
  27. mkdir -p ~/.local
  28. curl -sSL https://github.com/SonarSource/travis-utils/tarball/v47 | tar zx --strip-components 1 -C ~/.local
  29. source ~/.local/bin/install
  30. }
  31. configureTravis
  32. #
  33. # Travis fails on timeout when build does not print logs
  34. # during 10 minutes. This aims to bypass this
  35. # behavior when building the slow sonar-server sub-project.
  36. #
  37. keep_alive() {
  38. while true; do
  39. echo -en "\a"
  40. sleep 60
  41. done
  42. }
  43. keep_alive &
  44. # When a pull request is open on the branch, then the job related
  45. # to the branch does not need to be executed and should be canceled.
  46. # It does not book slaves for nothing.
  47. # @TravisCI please provide the feature natively, like at AppVeyor or CircleCI ;-)
  48. cancel_branch_build_with_pr || if [[ $? -eq 1 ]]; then exit 0; fi
  49. case "$TARGET" in
  50. BUILD)
  51. installJdk8
  52. ./gradlew build --no-daemon --console plain
  53. ;;
  54. WEB_TESTS)
  55. ./gradlew :server:sonar-web:yarn :server:sonar-web:yarn_validate --no-daemon --console plain
  56. ./gradlew :server:sonar-bitbucketcloud:yarn :server:sonar-bitbucketcloud:yarn_validate --no-daemon --console plain
  57. ./gradlew :server:sonar-vsts:yarn :server:sonar-vsts:yarn_validate --no-daemon --console plain
  58. ;;
  59. *)
  60. echo "Unexpected TARGET value: $TARGET"
  61. exit 1
  62. ;;
  63. esac