diff options
author | Karel Kočí <cynerd@email.cz> | 2020-04-21 14:55:24 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2020-04-21 14:55:24 +0200 |
commit | b1acd8c1fd4a4f43c01bff83fd6cfb5889693102 (patch) | |
tree | 3a02cc81f4d43d5ac0160fc8545e7ea77633da8a /templates | |
parent | 199a0ecd620e7af5b08b74acbab49f201a8f5af1 (diff) | |
download | laminar-cnf-b1acd8c1fd4a4f43c01bff83fd6cfb5889693102.tar.gz laminar-cnf-b1acd8c1fd4a4f43c01bff83fd6cfb5889693102.tar.bz2 laminar-cnf-b1acd8c1fd4a4f43c01bff83fd6cfb5889693102.zip |
Do not use repo_checkout and instead use script
This is prepared for repo_checkout removal.
Diffstat (limited to 'templates')
-rwxr-xr-x | templates/turris.run | 43 |
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" |