From c7a2d9f27548f9449b3f0f0c91239115e809e0c0 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Thu, 19 Nov 2026 21:14:16 -0800 Subject: [PATCH] arm64-attach: run the plan step after Buildx setup (imagetools needs the plugin); show inspect errors Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6 --- .gitea/workflows/arm64-attach.yaml | 28 ++++++++++++++-------------- scripts/attach-arm64-index.sh | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/arm64-attach.yaml b/.gitea/workflows/arm64-attach.yaml index fad71ac..1816329 100644 --- a/.gitea/workflows/arm64-attach.yaml +++ b/.gitea/workflows/arm64-attach.yaml @@ -75,20 +75,6 @@ jobs: username: ${{ secrets.CI_USER }} password: ${{ secrets.CI_TOKEN }} - # Cheap pre-check BEFORE the 10-20 minute build: tag exists, has exactly one amd64 entry, - # and has no arm64 entry yet (exit 3 otherwise). Writes nothing. The index digest read here - # is handed to the final step, which refuses if the tag moved in between. - - name: Plan (read the tag, no writes) - id: plan - env: - REPO: ${{ steps.v.outputs.repo }} - TAG: ${{ steps.v.outputs.tag }} - FORCE: ${{ steps.v.outputs.force }} - run: | - set -euo pipefail - f=(); [ "$FORCE" = true ] && f=(--force) - scripts/attach-arm64-index.sh --repo "$REPO" --tag "$TAG" --plan-only "${f[@]}" - - name: Resolve base image digest (Docker Hub, direct) id: base env: @@ -136,6 +122,20 @@ jobs: if: steps.pkgcache.outputs.mirror == '' uses: docker/setup-buildx-action@v3 + # (needs the buildx plugin, hence after the Buildx setup) Cheap pre-check BEFORE the long build: tag exists, has exactly one amd64 entry, + # and has no arm64 entry yet (exit 3 otherwise). Writes nothing. The index digest read here + # is handed to the final step, which refuses if the tag moved in between. + - name: Plan (read the tag, no writes) + id: plan + env: + REPO: ${{ steps.v.outputs.repo }} + TAG: ${{ steps.v.outputs.tag }} + FORCE: ${{ steps.v.outputs.force }} + run: | + set -euo pipefail + f=(); [ "$FORCE" = true ] && f=(--force) + scripts/attach-arm64-index.sh --repo "$REPO" --tag "$TAG" --plan-only "${f[@]}" + - name: Cache-bust value id: bust env: diff --git a/scripts/attach-arm64-index.sh b/scripts/attach-arm64-index.sh index 03c85ed..e3973d5 100755 --- a/scripts/attach-arm64-index.sh +++ b/scripts/attach-arm64-index.sh @@ -75,7 +75,7 @@ it() { $IMAGETOOLS "$1" "${bflag[@]}" "${@:2}"; } # tag_digest : manifest (index) digest of a ref; empty on failure. tag_digest() { - it inspect "$1" --format '{{.Manifest.Digest}}' 2>/dev/null | tail -n 1 | tr -d '[:space:]' || true + it inspect "$1" --format '{{.Manifest.Digest}}' 2>>"${ATTACH_STDERR:-/dev/stderr}" | tail -n 1 | tr -d '[:space:]' || true } # arch_of : image config architecture; empty on failure. arch_of() {