#!/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/$BOARD-$BRANCH/git-hash" > git-hash cat git-hash if [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then echo_info "Using previous version of SDK" flock --shared "$WORKSPACE/openwrt-sdk.lock" \ cp -a "$WORKSPACE/openwrt-sdk" openwrt else echo_info "Building new version of SDK" echo_stage "Get turris-build" git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$TB_HASH" echo_stage "Prepare SDK" TB_HASH="$(awk '/ \* turris-build\: /{print $3}' git-hash)" mkdir openwrt flock --exclusive "$WORKSPACE/openwrt-sdk.lock" /bin/sh -s <> feeds.conf ./scripts/feeds update personal ./scripts/feeds uninstall $(./scripts/feeds list -r personal | awk '{print $1}') ./scripts/feeds install -p personal -d y -f -a echo_stage "Compile packages from personal feed" $MAKE $(ls package/feeds/personal | sed -n 's/^\([^ ]*\).*$/package\/\1\/compile/p' | tr '\n' ' ') 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 <