From d6adab324f9791faa2767e072ede3c95b5d01cb7 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Thu, 24 Sep 2020 12:05:46 +0200 Subject: [PATCH] Try to update brew repeatedly in ios pipeline Signed-off-by: Patrik Stas --- wrappers/ios/ci/build.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wrappers/ios/ci/build.sh b/wrappers/ios/ci/build.sh index 24e0f1f6da..b72aa21191 100755 --- a/wrappers/ios/ci/build.sh +++ b/wrappers/ios/ci/build.sh @@ -48,7 +48,19 @@ setup() { echo "Update Homebrew" # brew doctor || 1 - brew update + + tries=0 + threshold=5 + while ! brew update; + do + tries=$(( $tries + 1 )) + echo echo "Brew update attempt ${tries}/${threshold} failed."; + if [ "$tries" -eq "${threshold}" ]; then + echo "Failed to update brew after ${threshold} attempts. Terminating." + exit 1 + fi; + sleep 5; + done echo "Install required native libraries and utilities" which pkg-config &>/dev/null || brew install pkg-config