Files
Lyra/scripts/build-push.sh
T
Jonathan 53e7f0b7f2 build: script to publish web/worker images to the Gitea registry
Adds scripts/build-push.sh (build + push lyra-web/lyra-worker :latest and
:<sha> to git.jger.nl) + a README 'Deploying to a server (pre-built images)'
section. The server pulls these via the vm-download ops repo (docker/lyra).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 01:06:46 +02:00

30 lines
1022 B
Bash
Executable File

#!/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 :<short-sha>
#
# 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"