#!/usr/bin/env bash # Builds every image this repo's pipeline/CI needs: the fuelish tools # image (tooling-container/Dockerfile) and the Android CI/release build # image (build-image/Dockerfile), each tagged from its own VERSION file, # plus pulls ollama/ollama (used by 0_run_ollama.sh). Does not push - test # the tools image with the numbered pipeline scripts and the # android-builder image with ./run-image.sh, then publish both with # ./upload-image.sh. set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" ROOT="$(pwd)" fail() { echo "PREFLIGHT FAIL: $*" >&2; exit 1; } command -v docker >/dev/null 2>&1 \ || fail "docker not found in PATH" TOOLS_IMAGE="${REGISTRY_IMAGE:-fuelish/tools}" ANDROID_IMAGE="${REGISTRY_ANDROID_IMAGE:-cr.ladkau.de/fuelish/android-builder}" if [ -f "$ROOT/registry.env" ]; then # shellcheck disable=SC1091 source "$ROOT/registry.env" TOOLS_IMAGE="${REGISTRY_IMAGE:-$TOOLS_IMAGE}" ANDROID_IMAGE="${REGISTRY_ANDROID_IMAGE:-$ANDROID_IMAGE}" fi TOOLS_VERSION="$(<"$ROOT/tooling-container/VERSION")" [ -n "$TOOLS_VERSION" ] || fail "tooling-container/VERSION is empty" ANDROID_VERSION="$(<"$ROOT/build-image/VERSION")" [ -n "$ANDROID_VERSION" ] || fail "build-image/VERSION is empty" echo "== Building $TOOLS_IMAGE:$TOOLS_VERSION ==" docker build \ -f "$ROOT/tooling-container/Dockerfile" \ -t "$TOOLS_IMAGE:$TOOLS_VERSION" \ -t "$TOOLS_IMAGE:latest" \ "$ROOT/tooling-container" echo "== Building $ANDROID_IMAGE:$ANDROID_VERSION ==" docker build \ -t "$ANDROID_IMAGE:$ANDROID_VERSION" \ -t "$ANDROID_IMAGE:latest" \ "$ROOT/build-image" echo "== Pulling ollama/ollama (used by 0_run_ollama.sh) ==" docker pull ollama/ollama echo "== Done ==" echo "Images: $TOOLS_IMAGE:$TOOLS_VERSION, $ANDROID_IMAGE:$ANDROID_VERSION (both also :latest)" echo "Test the tools image with the numbered pipeline scripts, the android-builder image with ./run-image.sh, then publish both with ./upload-image.sh"