forked from Fraunhofer-AISEC/trusted-connector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·27 lines (23 loc) · 833 Bytes
/
build.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
#!/bin/bash
set -o errexit -o pipefail -o noclobber -o nounset
# Save working directory
OLD_PWD="$PWD"
# Return to saved working directory on error/exit
trap_handler() {
cd "$OLD_PWD" || exit 9
}
trap "trap_handler" ERR EXIT INT TERM
cd "$(dirname "${BASH_SOURCE[0]}")" || return
echo "In case of build errors, please verify that recent versions of docker and docker-compose are installed."
echo ""
# Stop potentially conflicting gradle daemons
echo "Trying to stop potentially conflicting gradle daemons..."
./gradlew --stop
echo ""
# Pull is allowed to fail, ignore if it happens.
! docker-compose -f docker-build/docker-compose.yml pull
if [ -z "$*" ]; then
docker-compose -f docker-build/docker-compose.yml run --rm build-container
else
docker-compose -f docker-build/docker-compose.yml run --rm build-container "$*"
fi