From b1acd8c1fd4a4f43c01bff83fd6cfb5889693102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 21 Apr 2020 14:55:24 +0200 Subject: Do not use repo_checkout and instead use script This is prepared for repo_checkout removal. --- templates/turris.run | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'templates') 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 < .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" -- cgit v1.2.3