ci-release.sh 2.61 KB
Newer Older
1
#!/bin/bash
2
set -e
3 4 5 6

## This script will compile Gluon for all architectures, create the
## manifest and sign it. For that, you must have clone gluon and have a
## valid site config. Additionally, the signing key must be present in
Tobi042's avatar
Tobi042 committed
7 8 9
## ../../ecdsa-key-secret or defined as first argument.
## The second argument defines the branch (stable, beta, experimental).
## The third argument defines the version.
10 11 12
## Call from site directory with the version and branch variables
## properly configured in this script.

Ralf's avatar
Ralf committed
13
SIGNING_KEY=$(readlink -e "$1")
Ralf's avatar
Ralf committed
14
JOBS=$(nproc --all)
Ralf's avatar
Ralf committed
15

16 17 18 19 20
function run_and_print() {
    echo -e "\n\n\n$@"
    "$@"
}

21 22 23
cd ..
if [ ! -d "site" ]; then
	echo "This script must be called from within the site directory"
24
	exit 1
25
fi
26
. site/ansi-colors.sh # utilities
27

28
rm -rf output
29
# one-time preparation
Ralf's avatar
Ralf committed
30
run_and_print make update
Ralf's avatar
Ralf committed
31 32 33
. site/banner.sh # install our banner
cat openwrt/package/base-files/files/etc/banner
echo
34
# loop for a
Ralf's avatar
Ralf committed
35
for TARGET in \
Ralf's avatar
Ralf committed
36 37
	ar71xx-generic ar71xx-tiny ar71xx-nand \
	brcm2708-bcm2708 brcm2708-bcm2709 \
Ralf's avatar
Ralf committed
38
	mpc85xx-generic mpc85xx-p1020 \
Ralf's avatar
Ralf committed
39
	ramips-mt7620 ramips-mt7621 ramips-mt76x8 ramips-rt305x \
40
	sunxi-cortexa7 \
Ralf's avatar
Ralf committed
41
	ipq40xx \
Ralf's avatar
Ralf committed
42
	x86-generic x86-geode x86-64
43
do
Ralf's avatar
Ralf committed
44
	echo_color "$BOLDGREEN" "Starting work on target $TARGET"
Ralf's avatar
Ralf committed
45
	df -h
46
	# GLUON_BRANCH configures the default autoupdater branch.
Ralf's avatar
Ralf committed
47
	run_and_print make GLUON_TARGET="$TARGET" GLUON_BRANCH="$RELEASE_BRANCH" GLUON_RELEASE="$RELEASE_VERSION" -j$JOBS
48
        # We clean to avoid running out of disk space.
Ralf's avatar
Ralf committed
49
	run_and_print make GLUON_TARGET="$TARGET" clean -j$JOBS
50
	echo -e "\n\n\n============================================================\n\n"
51
done
Ralf's avatar
Ralf committed
52

Ralf's avatar
Ralf committed
53
echo_color "$BOLDGREEN" "Compilation complete, creating and signing manifest(s)"
54

Ralf's avatar
Ralf committed
55
run_and_print make GLUON_BRANCH=experimental GLUON_PRIORITY=1 GLUON_RELEASE=$RELEASE_VERSION manifest
56
run_and_print contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/experimental.manifest
57
echo -e "\n\n\n============================================================\n\n"
58

Ralf's avatar
Ralf committed
59
if [[ "$RELEASE_BRANCH" == "beta" ]] || [[ "$RELEASE_BRANCH" == "stable" ]]
60
then
Ralf's avatar
Ralf committed
61
	run_and_print make GLUON_BRANCH=beta GLUON_PRIORITY=2 GLUON_RELEASE=$RELEASE_VERSION manifest
62
	run_and_print contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/beta.manifest
63
	echo -e "\n\n\n============================================================\n\n"
64 65
fi

Ralf's avatar
Ralf committed
66
if [[ "$RELEASE_BRANCH" == "stable" ]]
67
then
Ralf's avatar
Ralf committed
68
	run_and_print make GLUON_BRANCH=stable GLUON_PRIORITY=7 GLUON_RELEASE=$RELEASE_VERSION manifest
69
	run_and_print contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/stable.manifest
70
	echo -e "\n\n\n============================================================\n\n"
71 72
fi

Tobi042's avatar
Tobi042 committed
73
cd site
Ralf's avatar
Ralf committed
74
echo_color "$BOLDGREEN" "Done :)"