forked from locationtech/geomesa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travisbuild.sh
executable file
·29 lines (21 loc) · 1016 Bytes
/
.travisbuild.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
#!/bin/bash
export PING_SLEEP=60s
export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export BUILD_OUTPUT=$WORKDIR/build.out
touch $BUILD_OUTPUT
# set up a repeating loop to send some output to Travis
echo [INFO] $(date -u '+%F %T UTC') - build starting
bash -c "while true; do sleep $PING_SLEEP; echo [INFO] \$(date -u '+%F %T UTC') - build continuing...; done" &
PING_LOOP_PID=$!
# build using the maven executable, not the zinc maven compiler (which uses too much memory)
mvn clean package 2>&1 | tee -a $BUILD_OUTPUT | grep -e 'Building GeoMesa' -e '\(maven-surefire-plugin\|maven-jar-plugin\|scala-maven-plugin.*:compile\)'
RESULT=${PIPESTATUS[0]} # capture the status of the maven build
# dump out the end of the build log, to show success or errors
tail -500 $BUILD_OUTPUT
if [[ $RESULT -ne 0 ]]; then
echo -e "[ERROR] Build failed!\n"
fi
# nicely terminate the ping output loop
kill $PING_LOOP_PID
# exit with the result of the maven build to pass/fail the travis build
exit $RESULT