#!/usr/bin/env bash # # Builds the image, runs the tests and pushes it to the private registry. # # ./deploy.sh 2026-09-22 # # Then deploy with the printed ansible-playbook command, or with the cutover # flags from deploy/ansible/readme.md. set -euo pipefail TAG="${1:-}" if [[ -z "$TAG" ]]; then echo "usage: deploy.sh (e.g. $(date +%Y-%m-%d) or a git short sha)" >&2 exit 1 fi IMAGE="registry.tanshu.com/menu-admin:${TAG}" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$ROOT" if [[ -z "${SKIP_TESTS:-}" ]]; then echo "==> tests" npm test npm run typecheck fi echo "==> building ${IMAGE}" docker build -t "$IMAGE" . echo "==> pushing ${IMAGE}" docker push "$IMAGE" cat <