summaryrefslogtreecommitdiff
path: root/templates/turris.run
diff options
context:
space:
mode:
Diffstat (limited to 'templates/turris.run')
-rwxr-xr-xtemplates/turris.run43
1 files changed, 24 insertions, 19 deletions
diff --git a/templates/turris.run b/templates/turris.run
index eb481fa..fe19330 100755
--- a/templates/turris.run
+++ b/templates/turris.run
@@ -2,40 +2,45 @@
# vim: ft=sh
. "$(dirname "$(readlink -f "$0")")/../job.common"
###################################################
-parallel=-j$(($(nproc) * 2)) -l$(nproc)
-make="make $paralel IS_TTY=1 BUILD_LOG=1"
+parallel="-j$(($(nproc) * 2)) -l$(nproc)"
+make="make $parallel BUILD_LOG=1"
if [ "$V" -ge 1 ]; then
parallel=-j1
- make="make -j1 IS_TTY=1 BUILD_LOG=1 V=99"
+ make="make -j1 BUILD_LOG=1 V=99"
fi
###################################################
-
-curl "https://repo.turris.cz/$ANIMAL/$BOARD/packages/git-hash" > git-hash
-cat git-hash
+export IS_TTY=1
# TODO take lock so we won't run multiple instances of new builds
+
if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then
echo_info "Using previous version of SDK"
tar -xzf "$WORKSPACE/openwrt.tar.gz"
else
echo_info "Building new version of SDK"
echo_stage "Get turris-build"
- TB_HASH="$(awk '/ \* turris-build: / {print $3}' git-hash)"
- git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$TB_HASH"
+ git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$ANIMAL"
+
+ echo_stage "Checkout appropriate branch"
+ (
+ cd turris-build
+ "$FILES/turris_checkout_repo_branch.sh" "$ANIMAL"
+ cat feeds.conf
+ )
echo_stage "Prepare SDK"
mkdir openwrt
(
- cd openwrt
- cat > .turris-build.conf <<EOF
-GIT_MIRROR="$TWORKSPACE/openwrt-git-mirror"
-DL_MIRROR="$TWORKSPACE/openwrt-dl-mirror"
-CCACHE_HOST_DIR="$TWORKSPACE/ccache-host"
-CCACHE_TARGET_DIR="$WORKSPACE/ccache-target"
-EOF
- sed -i 's/^PUBLISH_BRANCH="hbs"$/PUBLISH_BRANCH="hbk"/' defaults.sh # Tweak target to point to HBK
- ../turris-build/compile_pkgs -t "$BOARD" -p "$ANIMAL" $parallel \
- repo_prepare compile_tools compile_target autopkg
- $make package/usign/host/compile
+ cd openwrt
+ cat > .turris-build.conf <<-EOF
+ GIT_MIRROR="$TWORKSPACE/openwrt-git-mirror"
+ DL_MIRROR="$TWORKSPACE/openwrt-dl-mirror"
+ CCACHE_HOST_DIR="$TWORKSPACE/ccache-host"
+ CCACHE_TARGET_DIR="$WORKSPACE/ccache-target"
+ EOF
+ sed -i 's/^PUBLISH_BRANCH="hbs"$/PUBLISH_BRANCH="hbk"/' defaults.sh # Tweak target to point to HBK
+ ../turris-build/compile_pkgs -t "$BOARD" -p "$ANIMAL" $parallel \
+ prepare_tools autopkg
+ $make package/usign/host/compile
)
tar -czf openwrt.tar.gz openwrt
mv openwrt.tar.gz "$WORKSPACE/openwrt.tar.gz"