aboutsummaryrefslogtreecommitdiffstats
path: root/.extras
diff options
context:
space:
mode:
Diffstat (limited to '.extras')
-rwxr-xr-x.extras/test-build26
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() {