-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.sh
executable file
·23 lines (19 loc) · 698 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
#!/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 ""
# 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