113 lines
5.2 KiB
Bash
Executable file
113 lines
5.2 KiB
Bash
Executable file
#!/bin/bash
|
|
# =============================================================================
|
|
# Lilith Platform Live - Run Command
|
|
# =============================================================================
|
|
#
|
|
# Usage:
|
|
# ./run dev Start dev (docker + frontend + APIs)
|
|
# ./run build Build for production
|
|
# ./run deploy:quinn Trigger quinn.www deployment via Forgejo Actions CI
|
|
# ./run dev:infra Start infrastructure only (PostgreSQL)
|
|
# ./run dev:stop Stop all services
|
|
# ./run dev:waitlist Start waitlist API only
|
|
# ./run dev:merchant Start merchant API only
|
|
# ./run dev:status Health check all services
|
|
# ./run dev:logs [svc] View service logs
|
|
# ./run dev:quinn Start quinn.www frontend + contact-api + data-api + mailpit
|
|
# ./run dev:quinn:stop Stop quinn.www frontend + contact-api + data-api + mailpit
|
|
# ./run dev:quinn:status Health check quinn.www services
|
|
# ./run dev:mail Start Mailpit dev SMTP only (web UI: http://localhost:8025)
|
|
# ./run dev:mail:stop Stop Mailpit
|
|
#
|
|
# ./run dev:my Start quinn.my dashboard API on port 3024
|
|
# ./run dev:my:stop Stop quinn.my dashboard API
|
|
# ./run dev:my:status Health check quinn.my dashboard
|
|
# ./run deploy:my Trigger quinn.my deployment via Forgejo Actions CI
|
|
# ./run deploy:admin Trigger quinn.admin deployment via Forgejo Actions CI
|
|
# ./run deploy:data Trigger quinn.data deployment via Forgejo Actions CI
|
|
# ./run deploy:m Deploy quinn.m (--direct only — no CI workflow yet)
|
|
# ./run deploy:newsletter Trigger newsletter deployment via Forgejo Actions CI
|
|
# All deploy commands accept --direct to bypass CI (emergencies / rollback).
|
|
# ./run prod:vps [--flag] Full VPS IaC — packages, ufw, systemd, nginx, certs, hardening
|
|
# Flags: --packages --ufw --sysctl --ssh --fail2ban --dirs --systemd --nginx --docker --certs --secrets --health --verify
|
|
# ./run prod:black [--flag] Provision black as pull-based backup host for vps-0
|
|
# Flags: --restic --pguser --timer --test --verify
|
|
#
|
|
# ./run admin:seed-passphrase Seed admin passphrase on VPS
|
|
# ./run admin:migrate [dev|prod] Run DB migrations (default: prod)
|
|
#
|
|
# ./run dev:analytics Start transquinnftw analytics cluster (all 4 services)
|
|
# ./run dev:analytics:stop Stop analytics cluster
|
|
# ./run dev:analytics:status Health check analytics cluster
|
|
#
|
|
# ./run dev:image-protection Start image-protection backend API (:3030) + frontend (:5130)
|
|
# ./run dev:image-protection:stop Stop image-protection services
|
|
# ./run dev:image-protection:status Health check image-protection services
|
|
#
|
|
# ./run dev:newsletter Start comm-newsletter API on port 3026
|
|
# ./run dev:newsletter:ui Start comm-newsletter frontend on port 5126
|
|
# ./run dev:newsletter:stop Stop comm-newsletter API and frontend
|
|
# ./run dev:newsletter:status Health check comm-newsletter API and frontend
|
|
#
|
|
# ./run ci:trigger:quinn Trigger quinn.www deployment via Forgejo Actions (preferred)
|
|
# ./run ci:trigger:admin Trigger quinn.admin deployment via Forgejo Actions
|
|
# ./run ci:trigger:my Trigger quinn.my deployment via Forgejo Actions
|
|
# ./run ci:trigger:data Trigger quinn.data deployment via Forgejo Actions
|
|
# ./run ci:trigger:newsletter Trigger newsletter deployment via Forgejo Actions
|
|
# ./run ci:status Show recent workflow run statuses
|
|
# ./run ci:logs <workflow.yml> Show URL for latest run logs
|
|
# ./run ci:setup-host [flags] Provision Forgejo runner on black (IaC)
|
|
# Requires: FORGEJO_TOKEN env var (get from forge.black.local → user settings → applications)
|
|
#
|
|
# =============================================================================
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
export ROOT_DIR
|
|
|
|
export BUN_INSTALL="${BUN_INSTALL:-$HOME/.bun}"
|
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
|
|
|
COMMAND="${1:-dev}"
|
|
PREFIX="${COMMAND%%:*}"
|
|
|
|
case "$PREFIX" in
|
|
dev)
|
|
# shellcheck source=scripts/run/dev.sh
|
|
source "$ROOT_DIR/scripts/run/dev.sh" "$@"
|
|
;;
|
|
build)
|
|
# shellcheck source=scripts/run/build.sh
|
|
source "$ROOT_DIR/scripts/run/build.sh" "$@"
|
|
;;
|
|
deploy)
|
|
# shellcheck source=scripts/run/deploy.sh
|
|
source "$ROOT_DIR/scripts/run/deploy.sh" "$@"
|
|
;;
|
|
prod)
|
|
# shellcheck source=scripts/run/prod.sh
|
|
source "$ROOT_DIR/scripts/run/prod.sh" "$@"
|
|
;;
|
|
admin)
|
|
# shellcheck source=scripts/run/admin.sh
|
|
source "$ROOT_DIR/scripts/run/admin.sh" "$@"
|
|
;;
|
|
ci)
|
|
# shellcheck source=scripts/run/ci.sh
|
|
source "$ROOT_DIR/scripts/run/ci.sh" "$@"
|
|
;;
|
|
*)
|
|
echo "Unknown command: $COMMAND"
|
|
echo ""
|
|
echo "Usage: ./run <command>"
|
|
echo ""
|
|
echo "Prefixes:"
|
|
echo " dev:* Development commands (scripts/run/dev.sh)"
|
|
echo " build Build commands (scripts/run/build.sh)"
|
|
echo " deploy:* Deploy commands (scripts/run/deploy.sh)"
|
|
echo " prod:* Production bootstrap (scripts/run/prod.sh)"
|
|
echo " admin:* Admin utilities (scripts/run/admin.sh)"
|
|
echo ""
|
|
echo "Run './run <prefix>' with no subcommand for a full list."
|
|
exit 1
|
|
;;
|
|
esac
|