summaryrefslogtreecommitdiff
path: root/templates/turris3x.run
blob: 1327e243de7518f587a3abc91a856046f613579d (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
#!/bin/sh
# vim: ft=sh
set -e
. common

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

SDK="$WORKSPACE/sdk.tar.bz2"
if [ ! -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 -j4

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