diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-14 12:53:22 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-14 12:53:22 +0200 |
| commit | 3a99bb5ebfedd5db4d48b2564670fccf8f9b8e8f (patch) | |
| tree | aeae2bb3a6d05c054eb7420c5dcb130b4ebe03ef /.extras | |
| parent | be7880b69c248c405faa8d5f0a4f11178a4b9b05 (diff) | |
| download | sbo-slackbuilds-3a99bb5ebfedd5db4d48b2564670fccf8f9b8e8f.tar.gz sbo-slackbuilds-3a99bb5ebfedd5db4d48b2564670fccf8f9b8e8f.zip | |
test-build: auto-pull the image from the LAN registry when missing
require_image now docker-pulls ACTIVE_IMAGE (a fully-qualified registry ref)
if it is not already local, instead of erroring out and telling the user to
pull by hand. Only errors if the pull itself fails. Pull-if-missing only: a
stale local tag is not refreshed (noted for a future --pull flag).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to '.extras')
| -rwxr-xr-x | .extras/test-build | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/.extras/test-build b/.extras/test-build index 0a655c1..681ddf7 100755 --- a/.extras/test-build +++ b/.extras/test-build @@ -745,18 +745,24 @@ print_summary() { } -# Verify the selected image exists locally. It is built by a separate job; this -# script only consumes it. (Later: a local-registry docker pull slots in here.) +# Ensure the selected image is available locally. It is built by a separate job +# (the image-builder) and pushed to the LAN registry; this script only consumes +# it. If it is not already local, pull it once (ACTIVE_IMAGE is a fully-qualified +# registry ref). A stale local tag is not refreshed here. +# ponytail: pull-if-missing only. If the registry's :current is rebuilt, the +# local copy goes stale silently. Add a --pull force-flag if that bites. require_image() { - if ! docker image inspect "$ACTIVE_IMAGE" >/dev/null 2>&1; then - cat >&2 <<EOF -Image not found locally: $ACTIVE_IMAGE -It is produced by the separate image-builder job (full Slackware $VERSION_ID + -sbo-maintainer-tools + sbopkg), stored on the NAS / local registry. Load or -pull it, then rerun. This script does not build images. + docker image inspect "$ACTIVE_IMAGE" >/dev/null 2>&1 && return 0 + echo "Image not present locally, pulling: $ACTIVE_IMAGE" >&2 + docker pull "$ACTIVE_IMAGE" >&2 && return 0 + cat >&2 <<EOF +Image not found and pull failed: $ACTIVE_IMAGE +It is produced by the image-builder job (full Slackware $VERSION_ID + +sbo-maintainer-tools + sbopkg) and pushed to the LAN registry. Check the +registry is reachable and the tag exists, then rerun. This script does not +build images. EOF - exit 1 - fi + exit 1 } main() { |
