-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (55 loc) · 1.99 KB
/
Copy pathMakefile
File metadata and controls
72 lines (55 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
COMPOSE := docker compose -f deploy/compose.dev.yml
NEMO := ./bin/nemo
SCALE ?= dev
ROLE ?= serve
PORT ?= 3000
.PHONY: help up down logs provision transform seed serve test test-db check lint doctor env-examples build image clean
help:
@echo "make up postgres for local work"
@echo "make down stop everything"
@echo "make provision schemas, roles, grants, both migration sets"
@echo "make transform dbt build"
@echo "make seed seed, transform and verify [SCALE=tiny|dev|full]"
@echo "make serve the dashboard on PORT=$(PORT)"
@echo "make test-db rebuild the database the rails suite runs against"
@echo "make test pytest and rails test"
@echo "make check every headline against a second source"
@echo "make lint ruff and rubocop"
@echo "make doctor the env a role needs [ROLE=$(ROLE)]"
@echo "make env-examples regenerate deploy/env/*.env.example"
@echo "make image build the one image"
@echo "make clean drop the test database"
up:
$(COMPOSE) up -d postgres
down:
$(COMPOSE) down
logs:
$(COMPOSE) logs -f
provision:
$(NEMO) provision --create
transform:
$(NEMO) transform
seed:
$(NEMO) seed --scale $(SCALE)
serve:
PORT=$(PORT) $(NEMO) serve
test-db:
POSTGRES_DB=$${POSTGRES_TEST_DB:-mnemosyne_test} $(NEMO) provision --create
POSTGRES_DB=$${POSTGRES_TEST_DB:-mnemosyne_test} $(NEMO) seed --scale tiny
test:
cd pipeline && PYTHONPATH=. .venv/bin/python -m pytest -q
cd web && bin/rails test
check:
cd pipeline && PYTHONPATH=. .venv/bin/python -m checks.headlines $(CHECK_ARGS)
lint:
cd pipeline && .venv/bin/ruff check .
cd web && bundle exec rubocop
doctor:
$(NEMO) doctor $(ROLE)
env-examples:
cd pipeline && PYTHONPATH=. .venv/bin/python -m lib.config --write
build image:
docker build -t mnemosyne:latest .
clean:
$(COMPOSE) exec -T postgres psql -U $${POSTGRES_USER:-postgres} -d postgres \
-c "drop database if exists $${POSTGRES_TEST_DB:-mnemosyne_test} with (force)"