From df8e5bf96f2c96e231e9543203aac9fc19d64e0d Mon Sep 17 00:00:00 2001 From: BtbN Date: Tue, 4 Jan 2022 19:49:05 +0100 Subject: [PATCH] Try building Linux images again with aggressiv fetch retries --- .github/workflows/build.yml | 2 +- images/base/git-mini-clone.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4325f74..2f13eb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,7 @@ jobs: strategy: fail-fast: false matrix: - target: [win64] + target: [win64,linux64] variant: [gpl,lgpl,gpl 4.4,lgpl 4.4,gpl-shared,lgpl-shared,gpl-shared 4.4,lgpl-shared 4.4] steps: - name: Checkout diff --git a/images/base/git-mini-clone.sh b/images/base/git-mini-clone.sh index 29ff3a8..b924ada 100755 --- a/images/base/git-mini-clone.sh +++ b/images/base/git-mini-clone.sh @@ -5,6 +5,18 @@ REF="$2" DEST="$3" git init "$DEST" git -C "$DEST" remote add origin "$REPO" -git -C "$DEST" fetch --depth=1 origin "$REF" + +RETRY_COUNTER=0 +MAX_RETRY=15 +while [[ $RETRY_COUNTER -lt $MAX_RETRY ]]; do + timeout 120 git -C "$DEST" fetch --depth=1 origin "$REF" && break || sleep 10 + RETRY_COUNTER=$(( $RETRY_COUNTER + 1 )) + echo "Retry $RETRY_COUNTER..." +done +if [[ $RETRY_COUNTER -ge $MAX_RETRY ]]; then + echo "Max retry count exceeded." + exit 1 +fi + git -C "$DEST" config advice.detachedHead false git -C "$DEST" checkout FETCH_HEAD