diff --git a/Makefile b/Makefile index 30ab93f..3b4b937 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # The workspace root delegates to these (see ../Makefile). .PHONY: dev-utils dev dev-local up down update install dev-backend dev-frontend \ - generate-client seed-example seed-demo test test-backend test-frontend soak bench-startup lint lint-backend \ + generate-client seed-example seed-demo seed-hosted-demo test test-backend test-frontend soak bench-startup lint lint-backend \ lint-frontend umami clean help COMPOSE_ROOT := $(CURDIR) @@ -97,6 +97,20 @@ seed-example: ## Seed the querying-chart example (needs a running stack + Influ seed-demo: ## Seed the training-run example: a batch flow and its dashboard cd backend && uv run python ../scripts/seed_demo_training.py +# Operators of the hosted demo only — NOT part of any deployment, and nothing a +# self-hosted instance needs. It wipes and recreates its three flows and its +# dashboard, so re-running it is how the public demo is reset. +# `uv run` does not read .env, so the credentials are lifted out of it here; +# anything already exported wins, which is how a remote instance is targeted: +# API_URL=https://api.example.com make seed-hosted-demo +seed-hosted-demo: ## Seed the hosted demo panel (operators only; API_URL selects the instance) + @user=$$(grep -E '^FIRST_SUPERUSER=' $(COMPOSE_ROOT)/.env 2>/dev/null | head -1 | cut -d= -f2-); \ + pass=$$(grep -E '^FIRST_SUPERUSER_PASSWORD=' $(COMPOSE_ROOT)/.env 2>/dev/null | head -1 | cut -d= -f2-); \ + cd backend && \ + FIRST_SUPERUSER="$${FIRST_SUPERUSER:-$$user}" \ + FIRST_SUPERUSER_PASSWORD="$${FIRST_SUPERUSER_PASSWORD:-$$pass}" \ + uv run python ../scripts/seed_demo.py + # ── Testing ─────────────────────────────────────────────────────── test: test-backend test-frontend ## Run all tests (backend + frontend)