-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy path_build-and-test-all.sh
executable file
·57 lines (41 loc) · 1.41 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
# /bin/bash
set -e
./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS testClasses
if [ -z "$DOCKER_HOST_IP" ] ; then
if [ -z "$DOCKER_HOST" ] ; then
export DOCKER_HOST_IP=`hostname`
else
echo using ${DOCKER_HOST?}
XX=${DOCKER_HOST%\:*}
export DOCKER_HOST_IP=${XX#tcp\:\/\/}
fi
echo set DOCKER_HOST_IP $DOCKER_HOST_IP
fi
if [ "$1" = "--use-existing" ] ; then
shift;
else
./gradlew ${database}${mode}ComposeDown
fi
NO_RM=false
if [ "$1" = "--no-rm" ] ; then
NO_RM=true
shift
fi
if [ ! -z "$EXTRA_INFRASTRUCTURE_SERVICES" ]; then
./gradlew ${EXTRA_INFRASTRUCTURE_SERVICES}ComposeBuild
./gradlew ${EXTRA_INFRASTRUCTURE_SERVICES}ComposeUp
echo trying again - should do nothing
./gradlew -P dockerComposeNoCreate=true ${EXTRA_INFRASTRUCTURE_SERVICES}ComposeUp
fi
if [ -z "$SPRING_DATASOURCE_URL" ] ; then
export SPRING_DATASOURCE_URL=jdbc:mysql://${DOCKER_HOST_IP}/es-test
echo Set SPRING_DATASOURCE_URL $SPRING_DATASOURCE_URL
fi
./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* build -x :e2etest:test
./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* :e2etest:cleanTest :e2etest:testClasses
./gradlew ${database}${mode}ComposeBuild
./gradlew -P dockerComposeNoCreate=true ${database}${mode}ComposeUp
./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* -P ignoreE2EFailures=false :e2etest:cleanTest :e2etest:test
if [ $NO_RM = false ] ; then
./gradlew ${database}${mode}ComposeDown
fi