From 600693d41be1f48a0433d8731e1fdfa9ff86a2f9 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Fri, 12 May 2023 13:00:39 -0300 Subject: [PATCH] Retry submodule update during checkout in CI --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c80485ce3f..083b29de665 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,11 +48,12 @@ checkout: &checkout cd project git init git remote add origin $CIRCLE_REPOSITORY_URL + # Only download metadata when fetching. git fetch --depth 50 --filter=blob:none origin $CIRCLE_SHA1 git checkout FETCH_HEAD - # Initialize submodules recursively - git submodule update --init --recursive + # Initialize submodules recursively (retry 5 times on failure) + for i in $(seq 1 5); do git submodule update --init --recursive && s=0 && break || s=$? && sleep 5; done; (exit $s) # Called setup_env to setup a bunch of global variables used throughout the rest of the build process. # It takes the required CCI environment variables as inputs, and gives them normalised names for the rest of