forked from microservices-patterns/ftgo-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-and-test-all.sh
executable file
·94 lines (57 loc) · 1.58 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#! /bin/bash -e
KEEP_RUNNING=
ASSEMBLE_ONLY=
DATABASE_SERVICES="dynamodblocal mysql dynamodblocal-init"
if [ -z "$DOCKER_COMPOSE" ] ; then
DOCKER_COMPOSE=docker-compose
fi
while [ ! -z "$*" ] ; do
case $1 in
"--keep-running" )
KEEP_RUNNING=yes
;;
"--assemble-only" )
ASSEMBLE_ONLY=yes
;;
"--help" )
echo ./build-and-test-all.sh --keep-running --assemble-only
exit 0
;;
esac
shift
done
echo KEEP_RUNNING=$KEEP_RUNNING
. ./set-env.sh
# TODO Temporarily
./gradlew buildContracts
./gradlew testClasses
${DOCKER_COMPOSE?} down --remove-orphans -v
${DOCKER_COMPOSE?} up -d --build ${DATABASE_SERVICES?}
./gradlew waitForMySql
echo mysql is started
${DOCKER_COMPOSE?} up -d --build cdc-service
if [ -z "$ASSEMBLE_ONLY" ] ; then
./gradlew -x :ftgo-end-to-end-tests:test $* build
${DOCKER_COMPOSE?} build
./gradlew $* integrationTest
# Component tests need to use the per-service database schema
./gradlew :ftgo-order-service:cleanComponentTest :ftgo-order-service:componentTest
# Reset the DB/messages
${DOCKER_COMPOSE?} down --remove-orphans -v
${DOCKER_COMPOSE?} up -d ${DATABASE_SERVICES?}
./gradlew waitForMySql
echo mysql is started
${DOCKER_COMPOSE?} up -d
else
./gradlew $* assemble
${DOCKER_COMPOSE?} up -d --build ${DATABASE_SERVICES?}
./gradlew waitForMySql
echo mysql is started
${DOCKER_COMPOSE?} up -d --build
fi
./wait-for-services.sh
./run-end-to-end-tests.sh
./run-graphql-api-gateway-tests.sh
if [ -z "$KEEP_RUNNING" ] ; then
${DOCKER_COMPOSE?} down --remove-orphans -v
fi