fix(staging): retry exact gate checkout
This commit is contained in:
@@ -40,8 +40,20 @@ jobs:
|
||||
git init .
|
||||
git remote remove origin 2>/dev/null || true
|
||||
git remote add origin https://git.copse.top/root/Jyotisha.git
|
||||
git -c http.connectTimeout=15 -c http.lowSpeedLimit=1024 -c http.lowSpeedTime=30 \
|
||||
fetch --depth=1 --no-tags origin "$GITEA_SHA"
|
||||
fetch_succeeded=false
|
||||
for attempt in 1 2 3; do
|
||||
if timeout 300 git -c http.connectTimeout=15 -c http.lowSpeedLimit=1 -c http.lowSpeedTime=60 \
|
||||
fetch --depth=1 --no-tags origin "$GITEA_SHA"; then
|
||||
fetch_succeeded=true
|
||||
break
|
||||
fi
|
||||
if [ "$attempt" -eq 3 ]; then
|
||||
echo "exact staging gate checkout failed after $attempt bounded attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep $((attempt * 10))
|
||||
done
|
||||
[[ "$fetch_succeeded" == true ]]
|
||||
git checkout --detach --force "$GITEA_SHA"
|
||||
git clean -ffdx
|
||||
test "$(git rev-parse HEAD)" = "$GITEA_SHA"
|
||||
@@ -191,8 +203,20 @@ jobs:
|
||||
git init .
|
||||
git remote remove origin 2>/dev/null || true
|
||||
git remote add origin https://git.copse.top/root/Jyotisha.git
|
||||
git -c http.connectTimeout=15 -c http.lowSpeedLimit=1024 -c http.lowSpeedTime=30 \
|
||||
fetch --depth=1 --no-tags origin "$GITEA_SHA"
|
||||
fetch_succeeded=false
|
||||
for attempt in 1 2 3; do
|
||||
if timeout 300 git -c http.connectTimeout=15 -c http.lowSpeedLimit=1 -c http.lowSpeedTime=60 \
|
||||
fetch --depth=1 --no-tags origin "$GITEA_SHA"; then
|
||||
fetch_succeeded=true
|
||||
break
|
||||
fi
|
||||
if [ "$attempt" -eq 3 ]; then
|
||||
echo "exact staging gate checkout failed after $attempt bounded attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep $((attempt * 10))
|
||||
done
|
||||
[[ "$fetch_succeeded" == true ]]
|
||||
git checkout --detach --force "$GITEA_SHA"
|
||||
git clean -ffdx
|
||||
test "$(git rev-parse HEAD)" = "$GITEA_SHA"
|
||||
|
||||
Reference in New Issue
Block a user