-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·58 lines (47 loc) · 1.4 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
#!/bin/bash
set -x
SCRIPTPATH="$(dirname "$(readlink -e "$0")" )"
CORES=$(nproc)
RELEASE=$1
TARGETS=$2
rm -rf $SCRIPTPATH/output/$RELEASE
mkdir -p $SCRIPTPATH/output/$RELEASE/packages
if [ ! -h ${SCRIPTPATH}/gluon/site ]; then
ln -s ${SCRIPTPATH} ${SCRIPTPATH}/gluon/site
fi
cd gluon
if [ -z "$TARGETS" ]; then
TARGETS="$(make list-targets)"
fi
make update
for TARGET in ${TARGETS}; do
make -j$((CORES+1)) GLUON_TARGET=${TARGET} download
done
FAILED_TARGETS=
for TARGET in ${TARGETS}; do
echo ${TARGET}
make -j$((CORES+1)) GLUON_TARGET=${TARGET} GLUON_RELEASE=${RELEASE} GLUON_AUTOUPDATER_BRANCH=stable
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo $TARGET failed;
FAILED_TARGETS="$FAILED_TARGETS $TARGET"
fi
done
for TARGET in $FAILED_TARGETS; do
make -j1 GLUON_TARGET=${TARGET} GLUON_RELEASE=${RELEASE} GLUON_AUTOUPDATER_BRANCH=stable V=s
RESULT=$?
if [ $RESULT -ne 0 ]; then
make clean GLUON_TARGET=${TARGET}
echo $TARGET failed again;
echo "FAILED_TARGETS: $FAILED_TARGETS"
exit 1;
fi
done
make GLUON_AUTOUPDATER_BRANCH=stable GLUON_RELEASE=${RELEASE} manifest
mv output/images/sysupgrade/stable.manifest ${SCRIPTPATH}/output/$RELEASE/stable.manifest
mv output/packages/* ${SCRIPTPATH}/output/$RELEASE/packages/
mv output/images ${SCRIPTPATH}/output/$RELEASE/
for TARGET in ${TARGETS}; do
make clean GLUON_TARGET=${TARGET}
done
cd ..