diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 802b27d..1de1ebb 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -128,25 +128,41 @@ jobs: run: | echo "[INFO] Waiting for archives to appear in upload-repo..." - GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}" - git clone --depth=1 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo + mkdir -p temp-check + cd temp-check + # Retry loop for cloning the upload-repo + for i in {1..10}; do + echo "[INFO] Attempt $i: Cloning upload-repo..." + if git clone --depth=1 "https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git"; then + break + fi + echo "[WARN] Clone failed. Retrying in 10 seconds..." + sleep 10 + done + + if [ ! -d "debian-base" ]; then + echo "[ERROR] Failed to clone upload-repo after retries." + exit 1 + fi + + cd debian-base + + # Wait for all versions to show up for version in $VERSIONS; do - for i in {1..10}; do - if [[ -f "temp-check/$version/debian-$version.tar.bz2" ]]; then - echo "[OK] Found archive for $version" + for i in {1..30}; do + if [[ -f "$version/debian-$version.tar.bz2" ]]; then + echo "[OK] Found $version archive" break else echo "[WAIT] $version not ready yet, sleeping 10s..." sleep 10 - git -C temp-check pull --rebase --quiet - fi - - if [[ $i -eq 10 ]]; then - echo "[ERROR] Archive $version did not appear in time." - exit 1 fi done + if [[ ! -f "$version/debian-$version.tar.bz2" ]]; then + echo "[ERROR] $version archive still missing after wait period." + exit 1 + fi done - name: Set up Docker Buildx