Files
containers/images/vibe-kanban-remote/build.sh
rob thijssen dff283c468
Some checks failed
images / hermes (push) Failing after 59s
images / vibe-kanban-remote (push) Has been cancelled
feat(vibe-kanban-remote): build the self-hosted remote-server image
Builds crates/remote/Dockerfile from our mirror at git.lair.cafe rather than
from GitHub, and resolves the version from the mirror's tags rather than
GitHub's releases API. BloopAI has announced a sunset; the mirror exists so
this build outlives them, which is pointless if the build still asks
github.com what to build. Nothing in this image's path touches GitHub.

Gitea mirrors carry tags but not releases, so latest is resolved by filtering
to the strict release pattern v<semver>-<14-digit datestamp> and sorting on
the datestamp -- which also skips the malformed historical tags in the
upstream repo (vv.20250708094151, vv0.0.40-nbump.2....).

FEATURES is deliberately left unset: the Dockerfile strips the private
billing crate only when it is empty, which is the documented self-host path.
Setting it would send the build looking for BloopAI/vibe-kanban-private over
SSH, which we cannot reach.

Consumed by the vibe-kanban quadlets on bob (kanban.internal).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsmUEtbyTkgQ18tCFYXo1h
2026-07-20 18:18:43 +03:00

51 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build the vibe-kanban remote-server image locally, mirroring the `images` workflow.
#
# vibe-kanban ships its own Dockerfile (crates/remote/Dockerfile, context = repo
# root), so there is no vendored Containerfile here.
#
# Unlike hermes, the build context is OUR MIRROR (git.lair.cafe/BloopAI/vibe-kanban)
# rather than GitHub, and the version is resolved from the mirror's tags rather than
# GitHub's releases API. BloopAI has announced a sunset; the whole point of the
# mirror is that this build keeps working after upstream disappears, so it must not
# depend on GitHub at build time. See the BloopAI org description on git.lair.cafe.
#
# Gitea mirrors do not carry GitHub *releases*, only tags — hence tag resolution by
# strict pattern (v<semver>-<14-digit datestamp>) sorted on the datestamp. That
# filter also skips the malformed historical tags in this repo (e.g. `vv.2025…`).
#
# Override the ref with VK_REF (e.g. v0.1.44-20260424091429); empty resolves latest.
set -euo pipefail
REGISTRY="${REGISTRY:-git.lair.cafe}"
IMAGE_NAME="${REGISTRY}/lair/vibe-kanban-remote"
MIRROR_API="https://git.lair.cafe/api/v1/repos/BloopAI/vibe-kanban/tags"
MIRROR_GIT="https://git.lair.cafe/BloopAI/vibe-kanban.git"
VK_REF="${VK_REF:-}"
# The frontend bakes this in at build time; empty disables the relay/tunnel
# features, which we do not deploy. Changing it requires a rebuild, not a restart.
VITE_RELAY_API_BASE_URL="${VITE_RELAY_API_BASE_URL:-}"
if [ -z "${VK_REF}" ]; then
VK_REF=$(for p in 1 2 3 4 5; do
curl -fsS "${MIRROR_API}?limit=100&page=${p}" | jq -r '.[].name'
done \
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-[0-9]{14}$' \
| sort -t- -k2 -n \
| tail -1)
fi
[ -n "${VK_REF}" ] || { echo "could not resolve a vibe-kanban ref from the mirror"; exit 1; }
VERSION="${VK_REF#v}"
echo "building ${IMAGE_NAME}:${VERSION} from ${MIRROR_GIT}#${VK_REF}"
podman build --pull=newer \
-f crates/remote/Dockerfile \
--build-arg "VITE_RELAY_API_BASE_URL=${VITE_RELAY_API_BASE_URL}" \
-t "${IMAGE_NAME}:${VERSION}" \
-t "${IMAGE_NAME}:latest" \
"${MIRROR_GIT}#${VK_REF}"
echo "built ${IMAGE_NAME}:${VERSION} and :latest"
echo "push with: podman push ${IMAGE_NAME}:${VERSION} && podman push ${IMAGE_NAME}:latest"