-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_starly.sh
executable file
·62 lines (57 loc) · 2.23 KB
/
build_starly.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
#!/usr/bin/env bash
test "site" = "$(basename "$(dirname "$(realpath "$0")")")" || exit
cd "$(dirname "$0")"/.. || exit
. ./site/build_vars.sh
GLUON_RELEASE="${GLUON_RELEASE:-$(date +%Y.%m.%d)}"
if [ "$(git -C site branch --show-current)" != "main" ]; then
echo "Not on main branch."
exit
elif [ "$(git -C site status -s)" != "" ]; then
echo "Changes in main branch."
exit
fi
echo "Building Gluon Release ${GLUON_RELEASE} for targets: ${TARGETS}..."
if [ ! -f "$1" ]; then
echo "Manifest will not be signed, because no secret was given."
fi
echo "Cleaning Output..."
test -d ./output && rm -rf ./output
echo "Updating Modules..."
make update
for T in $TARGETS; do
echo "Building Target $T..."
make GLUON_TARGET="$T" GLUON_RELEASE="$GLUON_RELEASE" CONFIG_VERSIONOPT=y CONFIG_VERSION_NUMBER="$OPENWRT_VERSION" -j"$CPUS" GLUON_AUTOUPDATER_ENABLED=1
if [ "$?" != "0" ]; then
echo "Error building $T."
exit
fi
done
for BRANCH in stable early testing ; do
today=$( date +%Y-%m-%d )
in2w=$( date --date "2 weeks" +%Y-%m-%d )
in4w=$( date --date "4 weeks" +%Y-%m-%d )
if [ "$BRANCH" == "early" ]; then
make manifest GLUON_RELEASE="$GLUON_RELEASE" GLUON_AUTOUPDATER_BRANCH="$BRANCH" GLUON_PRIORITY="3"
sed -i "s/DATE=$today /DATE=$in2w /" output/images/sysupgrade/"${BRANCH}".manifest
elif [ "$BRANCH" == "stable" ]; then
make manifest GLUON_RELEASE="$GLUON_RELEASE" GLUON_AUTOUPDATER_BRANCH="$BRANCH" GLUON_PRIORITY="7"
sed -i "s/DATE=$today /DATE=$in4w /" output/images/sysupgrade/"${BRANCH}".manifest
else
make manifest GLUON_RELEASE="$GLUON_RELEASE" GLUON_AUTOUPDATER_BRANCH="$BRANCH" GLUON_PRIORITY="0"
fi
if [ -f "$1" ]; then
echo "Signing ${BRANCH}.manifest..."
contrib/sign.sh "$1" output/images/sysupgrade/"${BRANCH}".manifest
else
echo "${BRANCH}.manifest was not signed."
fi
done
echo "Creating Changelog..."
git -C site tag -d "${GLUON_RELEASE}" 2> /dev/null
(
git -C site remote get-url origin
git -C site diff -s && git -C site status -sb -uall
git -C site log "$(git -C site describe --abbrev=0 --tags)"..HEAD
) > output/images/"${GLUON_RELEASE}".changes
git -C site tag "${GLUON_RELEASE}"
echo "done."