-
Notifications
You must be signed in to change notification settings - Fork 76
/
build.sh
executable file
·41 lines (35 loc) · 748 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /usr/bin/env bash
set -e
set -x
version=$(cat VERSION)
cores=$(cat /proc/cpuinfo | grep ^processor | wc -l)
arch=${ARCH:-amd64}
docker=${DOCKER:-docker}
if [[ "${TAG}" ]]; then
tag="--tag ${TAG}"
fi
configure_args=""
while [ "$#" -gt 0 ]; do
case "$1" in
profiling)
configure_args="${configure_args} --enable-profiling --enable-profiling-locks"
;;
--*)
configure_args="${configure_args} $1"
;;
*)
echo "error: bad argument: $1"
exit 1
;;
esac
shift
done
${docker} build --rm \
--pull \
--platform linux/${arch} \
--build-arg VERSION=${version} \
--build-arg CORES=${cores} \
--build-arg CONFIGURE_ARGS="${configure_args}" \
${tag} \
-f Dockerfile.${arch} \
.