-
Notifications
You must be signed in to change notification settings - Fork 22
/
test.sh
executable file
·67 lines (52 loc) · 1.36 KB
/
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
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
#!/usr/bin/env bash
set -e
KEEP_RUNNING=
USE_EXISTING_CONTAINERS=
while [ ! -z "$*" ] ; do
case $1 in
"--keep-running" )
KEEP_RUNNING=yes
;;
"--use-existing-containers" )
USE_EXISTING_CONTAINERS=yes
;;
"--help" )
echo ./test.sh --keep-running --use-existing-containers
exit 0
;;
*)
echo ./test.sh --keep-running --use-existing-containers
exit 0
;;
esac
shift
done
if dotnet nuget list source | grep -q 'https://api.bintray.com/nuget/eventuateio-oss/eventuateio-dotnet-snapshots'; then
echo "Package already exists"
else
echo "Add package"
dotnet nuget add source https://api.bintray.com/nuget/eventuateio-oss/eventuateio-dotnet-snapshots
fi
docker-compose build
if [ -z "$USE_EXISTING_CONTAINERS" ] ; then
docker-compose down
fi
docker-compose up -d db
docker-compose run --rm wait-for-db
if [ -z "$USE_EXISTING_CONTAINERS" ] ; then
docker-compose run --rm dbsetup
fi
docker-compose up -d zookeeper
docker-compose up -d kafka
docker-compose up -d cdc-service
# Wait for docker containers to start up
./wait-for-services.sh
# Run Service
docker-compose up -d customer-service
#Run Tests
dotnet build EndToEndTests/EndToEndTests.csproj
dotnet test EndToEndTests/EndToEndTests.csproj
# Tear down test environment
if [ -z "$KEEP_RUNNING" ] ; then
docker-compose down -v --remove-orphans
fi