From 4ddd4057e2ab91e30f61cfa757605bfd0cca4d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 9 Feb 2019 17:34:28 +0100 Subject: turris: change how we do Turris 4.x --- templates/turris.run | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ templates/turris4x.run | 62 -------------------------------------------------- 2 files changed, 62 insertions(+), 62 deletions(-) create mode 100755 templates/turris.run delete mode 100755 templates/turris4x.run (limited to 'templates') diff --git a/templates/turris.run b/templates/turris.run new file mode 100755 index 0000000..5f4aeb3 --- /dev/null +++ b/templates/turris.run @@ -0,0 +1,62 @@ +#!/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 + +curl "https://repo.turris.cz/$ANIMAL/packages/$BOARD/git-hash" > git-hash +cat git-hash +# 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" + + echo_stage "Prepare SDK" + mkdir openwrt + ( + cd openwrt + cat > .turris-build.conf <> feeds.conf +./scripts/feeds update personal +./scripts/feeds list -r personal | awk '{print $1}' | xargs ./scripts/feeds uninstall # Remove any package provided by personal feed +./scripts/feeds install -p personal -d y -f -a + +echo_stage "Compile packages from personal feed" +find package/feeds/personal -mindepth 1 -maxdepth 1 -printf 'package/%P/compile\0' | \ + xargs --null $make + +echo_stage "Generate index and sign" +$make package/index BUILD_KEY=~/openwrt-repo.key + +echo_stage "Deploy" +ssh upload rm -rf "deploy-turris-$ANIMAL-$BOARD" +scp -r "bin/packages/$ARCH/personal" upload:deploy-turris-$BOARD +ssh upload /bin/sh -e < git-hash -cat git-hash -# 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" - - echo_stage "Prepare SDK" - mkdir openwrt - ( - cd openwrt - cat > .turris-build.conf <> feeds.conf -./scripts/feeds update personal -./scripts/feeds list -r personal | awk '{print $1}' | xargs ./scripts/feeds uninstall # Remove any package provided by personal feed -./scripts/feeds install -p personal -d y -f -a - -echo_stage "Compile packages from personal feed" -find package/feeds/personal -mindepth 1 -maxdepth 1 -printf 'package/%P/compile\0' | \ - xargs --null $make - -echo_stage "Generate index and sign" -$make package/index BUILD_KEY=~/openwrt-repo.key - -echo_stage "Deploy" -ssh upload rm -rf "deploy-turris4x-$BOARD" -scp -r "bin/packages/$ARCH/personal" upload:deploy-turris4x-$BOARD -ssh upload /bin/sh -e <