-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy path_build-and-test-all.sh
executable file
·68 lines (46 loc) · 1.68 KB
/
_build-and-test-all.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/bash
set -e
export COMPOSE_HTTP_TIMEOUT=240
docker="./gradlew ${DATABASE}${MODE}Compose"
if [ -z "$SPRING_DATA_MONGODB_URI" ] ; then
export SPRING_DATA_MONGODB_URI=mongodb://${DOCKER_HOST_IP:-localhost}/customers_orders
echo Set SPRING_DATA_MONGODB_URI $SPRING_DATA_MONGODB_URI
fi
if [ "$1" = "--use-existing" ] ; then
shift;
else
${docker}Down
fi
NO_RM=false
if [ "$1" = "--no-rm" ] ; then
NO_RM=true
shift
fi
./compile-contracts.sh
./gradlew --stacktrace $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* testClasses
./gradlew --stacktrace $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* build -x :e2e-test:test
${docker}Up
#Testing db cli
if [ "${DATABASE}" == "mysql" ]; then
echo 'show databases;' | ./mysql-cli.sh -i
elif [ "${DATABASE}" == "postgres" ]; then
echo '\l' | ./postgres-cli.sh -i
else
echo "Unknown Database"
exit 99
fi
#Testing mongo cli
echo 'show dbs' | ./mongodb-cli.sh -i
set -e
./gradlew -a $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* :e2e-test:cleanTest :e2e-test:test -P ignoreE2EFailures=false
./wait-for-services.sh ${DOCKER_HOST_IP:-localhost} readers/${READER}/finished 8099
compose="docker-compose -f docker-compose-eventuate-local-${DATABASE}-${MODE}.yml "
$compose stop cdc-service
curl -s https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/master/migration/db-id/migration.sh &> /dev/stdout | bash
$compose start cdc-service
${docker}Up -P envFile=docker-compose-env-files/db-id-gen.env
./gradlew -a $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* :e2e-test:cleanTest :e2e-test:test -P ignoreE2EFailures=false
./gradlew -P verifyDbIdMigration=true :migration-tests:cleanTest migration-tests:test
if [ $NO_RM = false ] ; then
${docker}Down
fi