#!/usr/bin/env bash # Build the Lyra web + worker images and push them to the Gitea container registry, so the VM # can pull pre-built images instead of building from source. # # Usage (from the Lyra repo root): # docker login git.jger.nl # once — Gitea username + a token with package:write # ./scripts/build-push.sh # builds + pushes :latest and : # # Override the registry namespace with LYRA_REGISTRY (default git.jger.nl/jonathan). set -euo pipefail REGISTRY="${LYRA_REGISTRY:-git.jger.nl/jonathan}" here="$(cd "$(dirname "$0")/.." && pwd)" sha="$(git -C "$here" rev-parse --short HEAD)" for svc in web worker; do img="$REGISTRY/lyra-$svc" echo "==> building $img ($sha)" docker build -t "$img:latest" -t "$img:$sha" "$here/$svc" done for svc in web worker; do img="$REGISTRY/lyra-$svc" echo "==> pushing $img:latest and $img:$sha" docker push "$img:latest" docker push "$img:$sha" done echo "Done. Pulled on the VM with: docker compose pull && docker compose up -d"