-
Notifications
You must be signed in to change notification settings - Fork 7
/
in_docker.sh
executable file
·42 lines (36 loc) · 1.23 KB
/
in_docker.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
#!/usr/bin/env bash
# This script is invoked by the docker builder and wraps up configuring the
# defconfig and actually wrapping the build. It also limits the verbosity
# of the buildroot output by only passing lines from make and saving the
# rest to a file.
set -o pipefail
set -e
set -v
filtered_build_log="/buildroot/buildlog.txt"
git config --global --add safe.directory /opentrons
git config --global --add safe.directory /buildroot
if [[ -n "${FILTER}" ]]; then
echo "in ci"
for w in $@; do
case "$w" in
"all")
filter=1
;;
"packages")
filter=1
;;
"toolchain")
filter=1
;;
esac
done;
fi
git config --global --add safe.directory /opentrons
git config --global --add safe.directory /buildroot
if [[ -z "${filter}" ]]; then
echo "Unfiltered make"
LC_CTYPE="en_US.UTF-8" LANGUAGE="en_US.UTF-8" LC_ALL="C" LANG="en_US.UTF-8" BR2_EXTERNAL=/opentrons make -C /buildroot "$@"
else
echo "Filtered make"
LC_CTYPE="en_US.UTF-8" LANGUAGE="en_US.UTF-8" LC_ALL="C" LANG="en_US.UTF-8" BR2_EXTERNAL=/opentrons make -C /buildroot "$@" 2> >(tee -a ${filtered_build_log}) > ${filtered_build_log}
fi