d5f4381169
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)
54 lines
2.2 KiB
Bash
Executable File
54 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Pushes every image ./build-image.sh built locally - the fuelish tools
|
|
# image and the Android CI/release build image, each already verified
|
|
# (tools image with the numbered pipeline scripts, android-builder image
|
|
# with ./run-image.sh) - to a container registry, so the k3s cluster can
|
|
# pull the tools image and Gitea Actions can pull the android-builder
|
|
# image without rebuilding either.
|
|
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"
|
|
|
|
[ -f "$ROOT/registry.env" ] \
|
|
|| fail "registry.env not found - copy registry.env.example to registry.env and fill in your registry credentials"
|
|
|
|
# shellcheck disable=SC1091
|
|
source "$ROOT/registry.env"
|
|
|
|
: "${REGISTRY:?registry.env must set REGISTRY}"
|
|
: "${REGISTRY_IMAGE:?registry.env must set REGISTRY_IMAGE}"
|
|
: "${REGISTRY_ANDROID_IMAGE:?registry.env must set REGISTRY_ANDROID_IMAGE}"
|
|
: "${REGISTRY_USER:?registry.env must set REGISTRY_USER}"
|
|
: "${REGISTRY_PASSWORD:?registry.env must set REGISTRY_PASSWORD}"
|
|
|
|
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"
|
|
|
|
docker image inspect "$REGISTRY_IMAGE:$TOOLS_VERSION" >/dev/null 2>&1 \
|
|
|| fail "$REGISTRY_IMAGE:$TOOLS_VERSION not found locally - run ./build-image.sh first"
|
|
docker image inspect "$REGISTRY_ANDROID_IMAGE:$ANDROID_VERSION" >/dev/null 2>&1 \
|
|
|| fail "$REGISTRY_ANDROID_IMAGE:$ANDROID_VERSION not found locally - run ./build-image.sh first"
|
|
|
|
echo "== Logging in to $REGISTRY =="
|
|
echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin
|
|
|
|
echo "== Pushing $REGISTRY_IMAGE:$TOOLS_VERSION and :latest =="
|
|
docker push "$REGISTRY_IMAGE:$TOOLS_VERSION"
|
|
docker push "$REGISTRY_IMAGE:latest"
|
|
|
|
echo "== Pushing $REGISTRY_ANDROID_IMAGE:$ANDROID_VERSION and :latest =="
|
|
docker push "$REGISTRY_ANDROID_IMAGE:$ANDROID_VERSION"
|
|
docker push "$REGISTRY_ANDROID_IMAGE:latest"
|
|
|
|
echo "== Done =="
|
|
echo "Images: $REGISTRY_IMAGE:$TOOLS_VERSION, $REGISTRY_ANDROID_IMAGE:$ANDROID_VERSION"
|