-
Notifications
You must be signed in to change notification settings - Fork 4
/
integration-test.sh
executable file
·36 lines (31 loc) · 1.31 KB
/
integration-test.sh
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
#!/usr/bin/env bash
set -e
./gradlew build
if [ "$IS_CIRCLE_CI" = "true" ]; then
echo "this is circle ci"
export FACTLIN_POSTGRES_DB_URL="jdbc:postgresql://localhost/factlin"
export FACTLIN_MARIA_DB_URL="jdbc:mariadb://127.0.0.1/sakila"
else
echo "this is not circle ci. use docker-machine ip"
DOCKER_MACHINE_IP=$(docker-machine ip)
export FACTLIN_POSTGRES_DB_URL="jdbc:postgresql://${DOCKER_MACHINE_IP}/factlin"
export FACTLIN_MARIA_DB_URL="jdbc:mariadb://${DOCKER_MACHINE_IP}/sakila"
fi
echo "FACTLIN_POSTGRES_DB_URL: ${FACTLIN_POSTGRES_DB_URL}"
echo "FACTLIN_MARIA_DB_URL: ${FACTLIN_MARIA_DB_URL}"
case $1 in
postgres-schema)
(cd ./sample-postgres-schema/ && ./gradlew --info --full-stacktrace factlin && ./gradlew test)
;;
postgres)
(cd ./sample-postgres/ && ./gradlew --info --full-stacktrace factlin && ./gradlew test)
;;
mariadb)
(cd ./sample-mariadb/ && ./gradlew --info --full-stacktrace factlin && ./gradlew test)
;;
*)
(cd ./sample-postgres-schema/ && ./gradlew --info --full-stacktrace factlin && ./gradlew test)
(cd ./sample-postgres/ && ./gradlew --info --full-stacktrace factlin && ./gradlew test)
(cd ./sample-mariadb/ && ./gradlew --info --full-stacktrace factlin && ./gradlew test)
;;
esac