summaryrefslogtreecommitdiff
path: root/templates/turris3x.run
blob: c354b5090a6d588cb6ec4a883ba1f32c801066ec (plain)
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
#!/bin/sh
# vim: ft=sh
. "$(dirname "$(readlink -f "$0")")/../job.common"

if [ "$V" -ge 1 ]; then
	MAKE="make -j1 IS_TTY=1 BUILD_LOG=1 V=99"
else
	MAKE="make -j4 IS_TTY=1 BUILD_LOG=1"
fi

echo_stage "Get packages"
git_clone "git@cynerd.cz:openwrt-personal-pkgs" pkgs turris3x

SDK="$WORKSPACE/sdk.tar.bz2"
if [ -n "$CLEAN" ] || [ ! -e "$SDK" ] || [ $(expr $(date -u +%s) - $(stat -c %Z "$SDK")) -gt 86400 ]; then
	echo_stage "Download SDK"
	curl "$SDK_URI" > sdk.tar.bz2
	mv sdk.tar.bz2 "$SDK"
else
	echo_stage "Skipping download"
fi

echo_stage "Export SDK"
tar -xjf "$WORKSPACE/sdk.tar.bz2"
cd OpenWrt-SDK-*

echo_stage "Copy packages"
cp -r ../pkgs/* package/

echo_stage "Build"
$MAKE

echo_stage "Sign"
./staging_dir/host/bin/usign -S -s ~/openwrt-repo.key -m "bin/$ARCH/packages/base/Packages"

echo_stage "Deploy"
ssh upload rm -rf "deploy-turris3x-$BOARD"
scp -r "bin/$ARCH/packages/base" upload:deploy-turris3x-$BOARD
ssh upload /bin/sh -e <<EOF
	mkdir -p /var/www/repo/turris3x
	rm -rf /var/www/repo/turris3x/$BOARD
	mv deploy-turris3x-$BOARD /var/www/repo/turris3x/$BOARD
EOF