Self-hosted live captioning from steveseguin/captionninja and steveseguin/caption-local. Upstream publishes no images, so images/build.sh builds them from pinned commits.
47 lines
1.8 KiB
Bash
Executable File
47 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build the three caption-ninja images from pinned upstream commits.
|
|
#
|
|
# Upstream publishes no images, so we build them ourselves. Run this on a
|
|
# Docker host (it needs no registry credentials); the 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
|
|
CAPTIONNINJA_COMMIT=dfcee8f551a2b175740ab9f73e3787e1458cce2d
|
|
CAPTION_LOCAL_COMMIT=7d759fe1eae100ccdb5de0eea82438c941b26582
|
|
RELAY_VERSION=0.2.0 # captionninja relay/package.json
|
|
CAPTION_LOCAL_VERSION=1.1.0 # caption-local VERSION
|
|
WEB_VERSION=2026.09.07 # captionninja has no releases: date of CAPTIONNINJA_COMMIT
|
|
|
|
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
work="${1:-$(mktemp -d)}"
|
|
|
|
checkout() { # url commit dir
|
|
rm -rf "$3"
|
|
git init -q "$3"
|
|
git -C "$3" fetch -q --depth 1 "$1" "$2"
|
|
git -C "$3" checkout -q FETCH_HEAD
|
|
}
|
|
|
|
checkout https://github.com/steveseguin/captionninja "$CAPTIONNINJA_COMMIT" "$work/captionninja"
|
|
checkout https://github.com/steveseguin/caption-local "$CAPTION_LOCAL_COMMIT" "$work/caption-local"
|
|
|
|
cn="${CAPTIONNINJA_COMMIT:0:7}"
|
|
cl="${CAPTION_LOCAL_COMMIT:0:7}"
|
|
|
|
docker build -t "$REGISTRY/caption-ninja-web:$WEB_VERSION-$cn" \
|
|
-f "$here/web/Dockerfile" "$work/captionninja"
|
|
docker build -t "$REGISTRY/caption-ninja-relay:$RELAY_VERSION-$cn" \
|
|
"$work/captionninja/relay"
|
|
docker build -t "$REGISTRY/caption-ninja-stt:$CAPTION_LOCAL_VERSION-$cl" \
|
|
"$work/caption-local"
|
|
|
|
echo
|
|
echo "Built:"
|
|
echo " $REGISTRY/caption-ninja-web:$WEB_VERSION-$cn"
|
|
echo " $REGISTRY/caption-ninja-relay:$RELAY_VERSION-$cn"
|
|
echo " $REGISTRY/caption-ninja-stt:$CAPTION_LOCAL_VERSION-$cl"
|