Add a custom Android CI/release build image and packaging scripts
build / build (push) Failing after 0s
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:
+23
-11
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Pushes the fuelish tools image - already built locally with
|
||||
# ./build-image.sh, and ideally verified with the numbered pipeline
|
||||
# scripts - to a container registry, so the k3s cluster (or other
|
||||
# machines) can pull it without rebuilding it.
|
||||
# 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]}")"
|
||||
@@ -21,21 +23,31 @@ 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}"
|
||||
|
||||
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"
|
||||
|
||||
docker image inspect "$REGISTRY_IMAGE:$VERSION" >/dev/null 2>&1 \
|
||||
|| fail "$REGISTRY_IMAGE:$VERSION not found locally - run ./build-image.sh first"
|
||||
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:$VERSION and :latest =="
|
||||
docker push "$REGISTRY_IMAGE:$VERSION"
|
||||
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 "Image: $REGISTRY_IMAGE:$VERSION"
|
||||
echo "Images: $REGISTRY_IMAGE:$TOOLS_VERSION, $REGISTRY_ANDROID_IMAGE:$ANDROID_VERSION"
|
||||
|
||||
Reference in New Issue
Block a user