8f5f54833f
Cheap insurance, explicitly not the real check -- the semantic tests in
deployment_config.rs are what prove propagation, using two TEST-NET addresses
and bind != advertise. This grep only stops the lab subnet reappearing months
from now when the reasoning has been forgotten.
Deployment config legitimately contains real addresses and lives in gitignored
files, so it is never scanned. The frozen baseline doc is allowlisted BY PATH:
it records what a past deployment actually was, and rewriting it would falsify
the record.
Also swapped the lab IP for a TEST-NET placeholder in the usage examples and
error messages of compose/entrypoint/client_arm. Those were already correct
architecture -- every one requires the address via ${VAR:?} -- but using the
real lab IP as the example is the same 'happens to match our lab' smell, and
placeholders keep the tripwire allowlist near-empty.
Mutation-tested: adding a lab address to a source file makes it exit 1.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
70 lines
2.0 KiB
Bash
Executable File
70 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# OpenFUT container registry helper.
|
|
#
|
|
# Usage:
|
|
# ./scripts/registry.sh login # docker login to the Gitea registry
|
|
# ./scripts/registry.sh build # build core + bridge images
|
|
# ./scripts/registry.sh push # push both images
|
|
# ./scripts/registry.sh release # build + push
|
|
# ./scripts/registry.sh pull # pull both images
|
|
#
|
|
# Config comes from .env (falls back to defaults matching docker-compose.yml).
|
|
# For login, set GITEA_USER and GITEA_TOKEN in the environment (a Gitea
|
|
# personal access token with package:write scope), or you'll be prompted.
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Load .env if present (without clobbering already-exported vars).
|
|
if [[ -f .env ]]; then
|
|
set -a; # shellcheck disable=SC1091
|
|
source .env; set +a
|
|
fi
|
|
|
|
REGISTRY="${REGISTRY:-git.aleshym.co}"
|
|
NAMESPACE="${NAMESPACE:-openfut}"
|
|
TAG="${TAG:-latest}"
|
|
|
|
CORE_IMAGE="${REGISTRY}/${NAMESPACE}/openfut-core:${TAG}"
|
|
BRIDGE_IMAGE="${REGISTRY}/${NAMESPACE}/openfut-bridge:${TAG}"
|
|
|
|
log() { printf '\033[1;36m==>\033[0m %s\n' "$*"; }
|
|
|
|
cmd_login() {
|
|
if [[ -n "${GITEA_USER:-}" && -n "${GITEA_TOKEN:-}" ]]; then
|
|
log "Logging in to ${REGISTRY} as ${GITEA_USER} (token)"
|
|
printf '%s' "${GITEA_TOKEN}" | docker login "${REGISTRY}" -u "${GITEA_USER}" --password-stdin
|
|
else
|
|
log "Logging in to ${REGISTRY} (interactive; set GITEA_USER/GITEA_TOKEN to automate)"
|
|
docker login "${REGISTRY}"
|
|
fi
|
|
}
|
|
|
|
cmd_build() {
|
|
log "Building ${CORE_IMAGE}"
|
|
docker build -t "${CORE_IMAGE}" ./openfut-core
|
|
log "Building ${BRIDGE_IMAGE}"
|
|
docker build -t "${BRIDGE_IMAGE}" ./openfut-bridge
|
|
}
|
|
|
|
cmd_push() {
|
|
log "Pushing ${CORE_IMAGE}"
|
|
docker push "${CORE_IMAGE}"
|
|
log "Pushing ${BRIDGE_IMAGE}"
|
|
docker push "${BRIDGE_IMAGE}"
|
|
}
|
|
|
|
cmd_pull() {
|
|
docker pull "${CORE_IMAGE}"
|
|
docker pull "${BRIDGE_IMAGE}"
|
|
}
|
|
|
|
case "${1:-}" in
|
|
login) cmd_login ;;
|
|
build) cmd_build ;;
|
|
push) cmd_push ;;
|
|
pull) cmd_pull ;;
|
|
release) cmd_build; cmd_push ;;
|
|
*) echo "Usage: $0 {login|build|push|pull|release}" >&2; exit 2 ;;
|
|
esac
|