aboutsummaryrefslogtreecommitdiffstats
path: root/travis.sh
blob: f9a97848f9b312872ad4b6f42d96057236b123e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash -v

set -euo pipefail

function configureTravis {
  mkdir -p ~/.local
  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v27 | tar zx --strip-components 1 -C ~/.local
  source ~/.local/bin/install
}
configureTravis

build_snapshot SonarSource/sonar-scanner-api

case "$TARGET" in

CI)
  regular_mvn_build_deploy_analyze
  ;;

IT)
  MIN_SQ_VERSION="LTS"
  mvn install -DskipTests=true -Dsource.skip=true -Denforcer.skip=true -B -e -V

  echo '======= Run integration tests on minimal supported version of SonarQube ($MIN_SQ_VERSION)'
  cd it
  mvn -Dsonar.runtimeVersion="$MIN_SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify -e -B -V
  # all other versions of SQ are tested by the QA pipeline at SonarSource
  ;;

*)
  echo "Unexpected TARGET value: $TARGET"
  exit 1
  ;;

esac