Files
caption-ninja/images/build.sh
T

38 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build the three caption-ninja images from a pinned captions-deploy commit.
#
# captions-deploy (git.coopcloud.tech/captions.coop/captions-deploy) pins the
# captions.coop forks of captionninja and caption-local as submodules and owns
# the UI image (web/Dockerfile). Nobody publishes images, so we build them here.
# Run this on a Docker host; it needs no registry credentials. Images are tagged
# with their final registry names so a single-node swarm can deploy them directly.
# See README.md "Images" for pushing them to the registry afterwards.
#
# usage: images/build.sh [workdir]
set -euo pipefail
REGISTRY=git.autonomic.zone/recipe-maintainers
DEPLOY_REPO=https://git.coopcloud.tech/captions.coop/captions-deploy.git
DEPLOY_COMMIT=dd47a21cfd7d86be599dfbf553bbf8e6c83fcc62
VERSION=2026.10.14 # date of DEPLOY_COMMIT; images share one semver-like tag
work="${1:-$(mktemp -d)}/captions-deploy"
tag="$VERSION-${DEPLOY_COMMIT:0:7}"
rm -rf "$work"
git init -q "$work"
git -C "$work" fetch -q --depth 1 "$DEPLOY_REPO" "$DEPLOY_COMMIT"
git -C "$work" checkout -q FETCH_HEAD
# Submodule URLs are SSH; fetch them anonymously over HTTPS instead.
git -C "$work" -c url."https://git.coopcloud.tech/".insteadOf="ssh://git@git.coopcloud.tech:2222/" \
submodule update -q --init --depth 1
git -C "$work" submodule status
docker build -t "$REGISTRY/caption-ninja-web:$tag" -f "$work/web/Dockerfile" "$work"
docker build -t "$REGISTRY/caption-ninja-relay:$tag" "$work/captionninja/relay"
docker build -t "$REGISTRY/caption-ninja-stt:$tag" "$work/caption-local"
echo
echo "Built:"
for image in web relay stt; do echo " $REGISTRY/caption-ninja-$image:$tag"; done