From 4584e7bc8db2bd60503811ce67ad252a5887f056 Mon Sep 17 00:00:00 2001 From: Eng1n33r <10697207+xMasterX@users.noreply.github.com> Date: Wed, 20 Jul 2022 21:25:02 +0300 Subject: [PATCH] use custom url in builds --- .drone.yml | 5 ++++- fbt | 2 ++ scripts/toolchain/unix-toolchain-download.sh | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index a4b235caf..39c265d5f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,17 +22,20 @@ steps: - mv dist/f7-C/* artifacts-default/ - ls -laS artifacts-default - ls -laS artifacts-default/f7-update-${DRONE_TAG} + environment: + FBT_TOOLS_CUSTOM_LINK: + from_secret: fbt_link - name: 'Bundle resources' image: kramos/alpine-zip commands: - - tar czpf artifacts-default/flipper-z-any-resources-${DRONE_TAG}.tgz -C assets resources - mkdir sd-card - mkdir -p sd-card/subghz/assets - mkdir -p sd-card/nfc/assets - mkdir -p sd-card/infrared/assets - cp assets/resources/subghz/assets/universal_rf_map sd-card/subghz/assets/universal_rf_map - cp assets/resources/subghz/assets/setting_user sd-card/subghz/assets/setting_user + - cp assets/resources/subghz/assets/keeloq_mfcodes sd-card/subghz/assets/keeloq_mfcodes - cp assets/resources/nfc/assets/mf_classic_dict.nfc sd-card/nfc/assets/mf_classic_dict.nfc - cp assets/resources/infrared/assets/tv.ir sd-card/infrared/assets/tv.ir - cp assets/resources/Manifest sd-card/Manifest diff --git a/fbt b/fbt index 0ea572b12..1bb19abb8 100755 --- a/fbt +++ b/fbt @@ -8,10 +8,12 @@ SCONS_DEFAULT_FLAGS="-Q --warn=target-not-built"; SCRIPT_PATH="$(cd "$(dirname "$0")" && pwd -P)"; if [ -z "${FBT_NOENV:-}" ]; then + echo "info: FBT_NOENV is not set, using included toolchain env"; . "$SCRIPT_PATH/scripts/toolchain/fbtenv.sh"; fi if [ -z "${FBT_NO_SYNC:-}" ]; then + echo "info: FBT_NO_SYNC is not set, running git submodule update"; if [ ! -d "$SCRIPT_PATH/.git" ]; then echo "\".git\" directory not found, please clone repo via \"git clone --recursive\""; exit 1; diff --git a/scripts/toolchain/unix-toolchain-download.sh b/scripts/toolchain/unix-toolchain-download.sh index 386be2a3c..aee8efe99 100755 --- a/scripts/toolchain/unix-toolchain-download.sh +++ b/scripts/toolchain/unix-toolchain-download.sh @@ -11,11 +11,21 @@ check_system() SYS_TYPE="$(uname -s)" if [ "$SYS_TYPE" = "Darwin" ]; then echo "darwin"; - TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-darwin-flipper-$VER.tar.gz"; + if [ -z "${FBT_TOOLS_CUSTOM_LINK:-}" ]; then + TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-darwin-flipper-$VER.tar.gz"; + else + echo "info: custom toolchain link is used"; + TOOLCHAIN_URL=$FBT_TOOLS_CUSTOM_LINK; + fi TOOLCHAIN_PATH="toolchain/x86_64-darwin"; elif [ "$SYS_TYPE" = "Linux" ]; then echo "linux"; - TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-linux-flipper-$VER.tar.gz"; + if [ -z "${FBT_TOOLS_CUSTOM_LINK:-}" ]; then + TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-linux-flipper-$VER.tar.gz"; + else + echo "info: custom toolchain link is used"; + TOOLCHAIN_URL=$FBT_TOOLS_CUSTOM_LINK; + fi TOOLCHAIN_PATH="toolchain/x86_64-linux"; else echo "unsupported.";