Add a custom Android CI/release build image and packaging scripts
build / build (push) Failing after 0s

- build-image/: Dockerfile bundling JDK 17, the Android SDK, and
  Node.js (needed by Gitea's JS-based actions) - the app has no
  native code, so no NDK
- build-image.sh/upload-image.sh: extended to also build/push this
  image alongside the existing OCR pipeline tools image
- run-image.sh: runs `make android` inside the image against a live
  checkout, for a CI-equivalent local build
- Makefile: `make android` builds and versions a release APK into
  dist/, from the current git tag
- .gitea/workflows/build.yml: now pulls the custom image and just
  runs `make android`, replacing the ad-hoc Node/SDK install steps
- README.md: describes the pipeline, server, app, and build tooling
- registry.env.example: fix REGISTRY_IMAGE to be fully-qualified
  (an unqualified name was silently resolving pushes to Docker Hub
  instead of the configured registry)
This commit is contained in:
ml
2026-09-29 17:48:02 +02:00
parent 516f5d3b7d
commit d5f4381169
10 changed files with 414 additions and 69 deletions
+27 -14
View File
@@ -1,9 +1,11 @@
#!/usr/bin/env bash
# Builds the fuelish tools image (tooling-container/Dockerfile) locally, tagged with
# tooling-container/VERSION and :latest, and pulls the other image the pipeline
# needs (ollama/ollama, used by 0_run_ollama.sh) so all images are ready before
# a pipeline run. Does not push - test it with the numbered pipeline scripts
# first, then publish with ./upload-image.sh.
# 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]}")"
@@ -14,26 +16,37 @@ fail() { echo "PREFLIGHT FAIL: $*" >&2; exit 1; }
command -v docker >/dev/null 2>&1 \
|| fail "docker not found in PATH"
IMAGE="${REGISTRY_IMAGE:-fuelish/tools}"
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"
IMAGE="${REGISTRY_IMAGE:-$IMAGE}"
TOOLS_IMAGE="${REGISTRY_IMAGE:-$TOOLS_IMAGE}"
ANDROID_IMAGE="${REGISTRY_ANDROID_IMAGE:-$ANDROID_IMAGE}"
fi
VERSION="$(<"$ROOT/tooling-container/VERSION")"
[ -n "$VERSION" ] || fail "tooling-container/VERSION is empty"
TOOLS_VERSION="$(<"$ROOT/tooling-container/VERSION")"
[ -n "$TOOLS_VERSION" ] || fail "tooling-container/VERSION is empty"
echo "== Building $IMAGE:$VERSION =="
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 "$IMAGE:$VERSION" \
-t "$IMAGE:latest" \
-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 "Image: $IMAGE:$VERSION (and :latest)"
echo "Test it with the numbered pipeline scripts, then publish with ./upload-image.sh"
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"