forked from naman0r/tandemcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 1.44 KB
/
Copy pathMakefile
File metadata and controls
40 lines (29 loc) · 1.44 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
# Everyday commands. `make` alone lists them.
BACKEND := apps/backend
WEB := apps/web
COMPOSE := docker compose -f $(BACKEND)/docker-compose.yml
.DEFAULT_GOAL := help
.PHONY: help setup up down logs web test lint check smoke
help: ## List the commands
@grep -E '^[a-z]+:.*## ' $(MAKEFILE_LIST) | awk -F ':.*## ' '{ printf " make %-7s %s\n", $$1, $$2 }'
setup: ## Copy the env templates and install web dependencies
@test -f $(BACKEND)/.env || cp $(BACKEND)/.env.example $(BACKEND)/.env
@test -f $(WEB)/.env || cp $(WEB)/.env.example $(WEB)/.env
cd $(WEB) && npm install
@echo "Now fill in DB_PASSWORD and the Clerk keys in $(BACKEND)/.env and $(WEB)/.env"
up: ## Start Postgres, the API and the runner
$(COMPOSE) up -d --build
down: ## Stop them
$(COMPOSE) down
logs: ## Follow the API and runner logs
$(COMPOSE) logs -f backend runner
web: ## Run the web app at http://localhost:5173
cd $(WEB) && npm run dev
test: ## Backend tests, in the API image against the compose database
$(COMPOSE) up -d db
$(COMPOSE) run --rm -v "$(CURDIR)/$(BACKEND):/workspace" backend sh -lc 'cd /workspace && HOME=/tmp pip install -q -r requirements-dev.txt && HOME=/tmp python -m pytest'
lint: ## Web lint and production build
cd $(WEB) && npm run lint && npm run build
check: test lint ## Everything CI runs
smoke: ## Check a deployment: make smoke [SITE=...] [API=...]
./infra/smoke.sh $(or $(SITE),https://tandemcode.space) $(or $(API),https://api.tandemcode.space)