-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.sh
executable file
·116 lines (91 loc) · 1.74 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
source script/config.cfg
usage() {
echo "Usage: ./build.sh <arch> <project> rebuild/post"
echo "Arch can be: "
echo " ppc64"
echo " ppc64le"
echo "Project can be:"
echo " all - runtime, next aspnetcore, next sdk"
echo " runtime"
echo " aspnetcore"
echo " sdk"
echo " if rebuild is used, all artifacts are cleaned before run build"
echo " if post is used, only post script will be run"
}
allprojects=(
"runtime"
"aspnetcore"
"sdk"
)
# check parameters
if [ $# -eq 0 ]; then
usage
exit 1
fi
case "$1" in
ppc64)
ARCH=ppc64
;;
ppc64le)
ARCH=ppc64le
;;
*)
echo "Wrong Architecture, available ppc64, ppc64le"
exit 1
;;
esac
REBUILD=0
ONLYPOST=0
if [ "$3" = "rebuild" ]; then
REBUILD=1
elif [ "$3" = "post" ]; then
ONLYPOST=1
fi
Test () {
for elemento in "${allprojects[@]}"; do
echo "$elemento"
done
}
PROJECT=$2
VALID_PROJECT=0
ALL_PROJECT=0
case "$2" in
runtime)
VALID_PROJECT=1
;;
aspnetcore)
VALID_PROJECT=1
;;
sdk)
VALID_PROJECT=1
;;
all)
ALL_PROJECT=1
;;
test)
Test
exit 0
;;
*)
echo "Wrong Parameters"
exit 1
;;
esac
source script/Common.sh
source script/BuildHelper.sh
BuildHelper_UpdateRootFSPath
#setup filesystem for chroot
BuildHelper_PreBuild
if [ "$ALL_PROJECT" -eq 1 ]; then
for elemento in "${allprojects[@]}"; do
PROJECT=$elemento
echo "Build Project $PROJECT"
BuildHelper_BuildProject $PROJECT
done
else
echo "Build Project $PROJECT"
BuildHelper_BuildProject $PROJECT
fi
# clean mounted filesystems for chroot
BuildHelper_PostBuild