diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 6ac6ae7..605f2b7 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: runs-on: docker-ready strategy: fail-fast: false - max-parallel: 3 + max-parallel: 9 matrix: service: - gateway @@ -171,15 +171,17 @@ jobs: git clone "https://forgejo-actions:${GITOPS_PAT}@${GITOPS_SERVER}/${GITOPS_OWNER}/${GITOPS_REPO}.git" /tmp/nxtgauge-gitops cd /tmp/nxtgauge-gitops - # Up to 3 of these jobs can be pushing to the same gitops branch at + # Up to 9 of these jobs can be pushing to the same gitops branch at # once now - retry with a fresh pull+rebase on a non-fast-forward # rejection instead of assuming we're the only writer. - for attempt in 1 2 3 4 5; do + pushed=false + for attempt in 1 2 3 4 5 6 7 8; do git checkout "$GITOPS_BRANCH" ./scripts/set-backend-rust-release.sh "$service" "$DIGEST" if git diff --quiet; then echo "GitOps repo already up to date for $service." + pushed=true break fi @@ -192,11 +194,17 @@ jobs: git commit -m "chore(gitops): update ${service} image for ${SHA}" if git push origin "HEAD:${GITOPS_BRANCH}"; then + pushed=true break fi - echo "Push rejected (attempt $attempt/5), pulling latest and retrying..." + echo "Push rejected (attempt $attempt/8), pulling latest and retrying..." git fetch origin "$GITOPS_BRANCH" git reset --hard "origin/${GITOPS_BRANCH}" sleep $((attempt * 2)) done + + if [ "$pushed" != true ]; then + echo "Failed to push gitops update for $service after all retries" >&2 + exit 1 + fi