set -euo pipefail
function installTravisTools {
- curl -sSL https://raw.githubusercontent.com/sonarsource/travis-utils/v14/install.sh | bash
- source /tmp/travis-utils/env.sh
+ mkdir ~/.local
+ curl -sSL https://github.com/SonarSource/travis-utils/tarball/v15 | tar zx --strip-components 1 -C ~/.local
+ source ~/.local/bin/install
}
function prepareIts {
installTravisTools
- travis_start_xvfb
+ start_xvfb
}
case "$JOB" in
psql -c 'create database sonar;' -U postgres
- travis_runDatabaseCI "postgresql" "jdbc:postgresql://localhost/sonar" "postgres" ""
+ runDatabaseCI "postgresql" "jdbc:postgresql://localhost/sonar" "postgres" ""
;;
MYSQL)
mysql -e "GRANT ALL ON sonar.* TO 'sonar'@'localhost';" -uroot
mysql -e "FLUSH PRIVILEGES;" -uroot
- travis_runDatabaseCI "mysql" "jdbc:mysql://localhost/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" "sonar" "sonar"
+ runDatabaseCI "mysql" "jdbc:mysql://localhost/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" "sonar" "sonar"
;;
WEB)
- export DISPLAY=:99.0
+ prepareIts
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
wget http://selenium-release.storage.googleapis.com/2.46/selenium-server-standalone-2.46.0.jar
nohup java -jar selenium-server-standalone-2.46.0.jar &
mvn install -Pit,dev -DskipTests -Dsonar.runtimeVersion=DEV -Dcategory="plugins" -Dmaven.test.redirectTestOutputToFile=false
;;
-*)
- echo "Invalid JOB choice [$JOB]"
- exit 1
-
esac