From 3b494cfc82ef39bb04fe9a40e0b896fa94a8c6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 26 Nov 2018 13:22:00 +0100 Subject: [PATCH] add fallback to downloading from DigitalOcean spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d2b11ac638..beb727d39d 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ help: ##@other Show this help @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST) +DO_SPACE_URL = https://status-go.ams3.digitaloceanspaces.com/ GITHUB_URL = https://github.com/status-im/status-go/releases/download RCTSTATUS_DIR = modules/react-native-status/ios/RCTStatus ANDROID_LIBS_DIR = android/app/libs @@ -47,15 +48,33 @@ prepare-desktop: ##@prepare Install desktop platform dependencies and prepare wo npm install $(STATUS_GO_IOS_ARCH): - curl -s -L \ + curl --fail --silent --location \ "$(GITHUB_URL)/$(STATUS_GO_VER)/status-go-ios.zip" \ - -o "$(STATUS_GO_IOS_ARCH)" + --output "$(STATUS_GO_IOS_ARCH)"; \ + if [ $$? -ne 0 ]; then \ + echo "Failed to download from GitHub, checking DigitalOcean Bucket..."; \ + curl --fail --silent --location \ + "${DO_SPACE_URL}/status-go-ios-$(STATUS_GO_VER).zip" \ + --output "$(STATUS_GO_IOS_ARCH)"; \ + if [ $$? -ne 0 ]; then \ + echo "Failed to download from DigitalOcean Spaces!"; \ + fi \ + fi $(STATUS_GO_DRO_ARCH): mkdir -p $(ANDROID_LIBS_DIR) - curl -s -L \ + curl --fail --silent --location \ "$(GITHUB_URL)/$(STATUS_GO_VER)/status-go-android.aar" \ - -o "$(STATUS_GO_DRO_ARCH)" + --output "$(STATUS_GO_DRO_ARCH)"; \ + if [ $$? -ne 0 ]; then \ + echo "Failed to download from GitHub, checking DigitalOcean Bucket..."; \ + curl --fail --silent --location \ + "${DO_SPACE_URL}/status-go-android-$(STATUS_GO_VER).aar" \ + --output "$(STATUS_GO_DRO_ARCH)"; \ + if [ $$? -ne 0 ]; then \ + echo "Failed to download from DigitalOcean Spaces!"; \ + fi \ + fi prepare-ios: $(STATUS_GO_IOS_ARCH) ##@prepare Install and prepare iOS-specific dependencies scripts/prepare-for-platform.sh ios