forked from leofionn/bibigo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bazel_build.sh
executable file
·48 lines (40 loc) · 1.03 KB
/
bazel_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
42
43
44
45
46
47
48
#!/bin/bash
type=${1}
echo "$(date) build..." >> /data/gitlab-runner/build.log
function compileall()
{
make build-keep-going
}
function compilepart()
{
pkgs=`.rider/changepkgs.sh`
exitCode=$?
if [[ ${exitCode} -ne 0 ]]; then
echo ".rider/changepkgs.sh fail"
exit ${exitCode}
fi
if [[ "${pkgs}" = "" ]]; then
echo "no changepkgs"
exit 0
fi
echo -e "change packages:\n${pkgs}\n"
paths=""
for pkg in ${pkgs}
do
if [[ "${paths}" != "" ]]; then
paths="${paths} union allpaths(//app/..., //${pkg}:all)"
else
paths="allpaths(//app/..., //${pkg}:all)"
fi
done
echo "bazel build..."
query=`bazel query "${paths}"`
echo -e "${query}\n"
bazel build --config=ci --watchfs -k $(echo -e "${query}" | grep -v all-srcs | grep -v package-srcs | grep -v _proto)
#bazel build $(bazel query "${paths}" |grep -v all-srcs |grep -v package-srcs)
}
if [[ "${type}" = "part" ]]; then
compilepart
else
compileall
fi