-
Notifications
You must be signed in to change notification settings - Fork 0
/
_build-and-test-all.sh
executable file
·56 lines (35 loc) · 1.4 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
#! /bin/bash
set -e
dockerall="./gradlew ${DATABASE?}${MODE?}Compose"
dockerinfrastructure="./gradlew ${DATABASE?}${MODE?}infrastructureCompose"
./gradlew testClasses
${dockerall}Down -P removeContainers=true
${dockerinfrastructure}Up
./gradlew -x :end-to-end-tests:test -x :snapshot-tests:test build
#Testing db cli
if [ "${DATABASE}" == "mysql" ]; then
echo 'show databases;' | ./mysql-cli.sh -i
elif [ "${DATABASE}" == "postgres" ]; then
echo '\l' | ./postgres-cli.sh -i
elif [ "${DATABASE}" == "mssql" ]; then
./mssql-cli.sh "SELECT name FROM master.sys.databases;"
else
echo "Unknown Database"
exit 99
fi
${dockerall}Build
${dockerall}Up
#Testing mongo cli
echo 'show dbs' | ./mongodb-cli.sh -i
./gradlew :end-to-end-tests:cleanTest :end-to-end-tests:test
echo Testing migration
./wait-for-services.sh localhost /readers/${READER}/finished "8099"
compose="docker-compose -f docker-compose-${DATABASE}-${MODE}.yml "
. ./_set-image-version-env-vars.sh
$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
${dockerall}Up -P envFile=docker-compose-env-files/db-id-gen.env
./gradlew :end-to-end-tests:cleanTest :end-to-end-tests:test
./gradlew -P verifyDbIdMigration=true :migration-tests:cleanTest migration-tests:test
${dockerall}Down -P removeContainers=true