- Add lib/db (Drizzle schema: 7 tables + 6 enums + relations, postgres.js client), drizzle.config.ts, lib/db/enums.ts (Prisma-compatible enum objects) - Rewrite all 14 app consumers + 4 admin components to Drizzle - Move the test DB layer to Drizzle + in-process PGlite; convert all 8 integration test files + factories (371 tests green) - Remove Prisma: deps, prisma/ schema+migrations, lib/prisma.ts, Dockerfile prisma generate; wire db:generate/migrate/push/studio to drizzle-kit; update Makefile - Preserve the old seed as scripts/legacy-prisma-seed.cjs (needs a Drizzle rewrite)
77 lines
2.1 KiB
Makefile
77 lines
2.1 KiB
Makefile
.PHONY: start stop restart deploy logs build ps port health clean-orphans app-shell db-shell db-init db-migrate db-generate test test-watch help
|
|
|
|
MIGRATION_NAME ?= init
|
|
|
|
start:
|
|
docker compose up -d --build
|
|
|
|
stop:
|
|
docker compose down
|
|
|
|
restart: stop start
|
|
|
|
deploy:
|
|
git pull
|
|
docker compose up -d --build
|
|
@git log -1 --oneline
|
|
|
|
logs:
|
|
docker compose logs -f --tail=200
|
|
|
|
build:
|
|
docker compose build
|
|
|
|
ps:
|
|
docker compose ps
|
|
|
|
port:
|
|
@echo "Site: http://localhost:3014"
|
|
@echo "Admin: http://rootmohfarawati.localhost:3014"
|
|
|
|
clean-orphans:
|
|
docker compose up -d --remove-orphans
|
|
|
|
app-shell:
|
|
docker compose exec app sh
|
|
|
|
db-shell:
|
|
docker compose exec db psql -U postgres -d moh_sass
|
|
|
|
db-init:
|
|
docker compose exec app npm run db:migrate
|
|
|
|
db-migrate:
|
|
docker compose exec app npm run db:migrate
|
|
|
|
test:
|
|
@node scripts/test-summary.mjs
|
|
|
|
test-watch:
|
|
npm run test:watch
|
|
|
|
db-generate:
|
|
docker compose exec app npm run db:generate
|
|
|
|
health:
|
|
curl -sS https://mohfarawati.de/api/health
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " make start Start all containers"
|
|
@echo " make stop Stop and remove containers"
|
|
@echo " make restart Restart all containers"
|
|
@echo " make deploy Pull latest code and deploy updated stack"
|
|
@echo " make logs Follow container logs"
|
|
@echo " make build Build images"
|
|
@echo " make ps Show container status"
|
|
@echo " make port Show app public URL"
|
|
@echo " make clean-orphans Remove orphaned old containers"
|
|
@echo " make app-shell Open shell in app container"
|
|
@echo " make db-shell Open PostgreSQL shell"
|
|
@echo " make db-init Apply Drizzle migrations to the DB"
|
|
@echo " make db-migrate Apply Drizzle migrations (drizzle-kit migrate)"
|
|
@echo " make db-generate Generate a migration from schema changes (drizzle-kit generate)"
|
|
@echo " make health Check app health endpoint via public domain"
|
|
@echo " make test Run the whole test suite + print a copy-paste summary"
|
|
@echo " make test-watch Run the test suite in watch mode"
|