diff options
author | David Gageot <david@gageot.net> | 2015-06-03 11:41:53 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2015-06-03 18:02:47 +0200 |
commit | 8f9e5e843e070afdf05cf0c9b4f1479e45e25542 (patch) | |
tree | 1f44564d66cb2aa518d3b90f6f618b2327a3b17b /travis.sh | |
parent | 35f206a6cefc849aa105769c2545d30257188de4 (diff) | |
download | sonarqube-8f9e5e843e070afdf05cf0c9b4f1479e45e25542.tar.gz sonarqube-8f9e5e843e070afdf05cf0c9b4f1479e45e25542.zip |
Run CI on h2/mysql/postgres
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/travis.sh b/travis.sh new file mode 100755 index 00000000000..b8a1b126d3f --- /dev/null +++ b/travis.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -euo pipefail + +function installTravisTools { + curl -sSL https://raw.githubusercontent.com/dgageot/travis-utils/master/install.sh | sh + source /tmp/travis-utils/utils.sh +} + +case "$DATABASE" in + +H2) + mvn verify -B -e -V + ;; + +POSTGRES) + installTravisTools + + psql -c 'create database sonar;' -U postgres + + runDatabaseCI "postgresql" "jdbc:postgresql://localhost/sonar" "postgres" '' + ;; + +MYSQL) + installTravisTools + + mysql -e "CREATE DATABASE sonar CHARACTER SET UTF8;" -uroot + mysql -e "CREATE USER 'sonar'@'localhost' IDENTIFIED BY 'sonar';" -uroot + mysql -e "GRANT ALL ON sonar.* TO 'sonar'@'localhost';" -uroot + mysql -e "FLUSH PRIVILEGES;" -uroot + + runDatabaseCI "mysql" "jdbc:mysql://localhost/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" "sonar" 'sonar' + ;; + +*) + echo "Invalid DATABASE choice [$DATABASE]" + exit 1 + +esac |