forked from the-momentum/open-wearables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
51 lines (38 loc) · 1.69 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
DOCKER_COMMAND = docker compose -f docker-compose.yml
DOCKER_EXEC = $(DOCKER_COMMAND) exec app
ALEMBIC_CMD = uv run alembic
help: ## Show this help.
@echo "============================================================"
@echo "This is a list of available commands for this project."
@echo "============================================================"
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
build: ## Builds docker image
$(DOCKER_COMMAND) build --no-cache
run: ## Runs the environment in detached mode
$(DOCKER_COMMAND) up -d --force-recreate
$(DOCKER_COMMAND) rm -f db-svix-init
up: ## Runs the non-detached environment
$(DOCKER_COMMAND) up --force-recreate
watch: ## Runs the environment with hot-reload
$(DOCKER_COMMAND) watch
stop: ## Stops running instance
$(DOCKER_COMMAND) stop
down: ## Kills running instance
$(DOCKER_COMMAND) down
test: ## Run the tests.
cd backend && uv run pytest -v --cov=app
migrate: ## Apply all migrations
$(DOCKER_EXEC) $(ALEMBIC_CMD) upgrade head
seed: ## Seed sample data (test users and activity data)
$(DOCKER_EXEC) uv sync --group dev
$(DOCKER_EXEC) uv run python scripts/init/seed_activity_data.py
create_migration: ## Create a new migration. Use 'make create_migration m="Description of the change"'
@if [ -z "$(m)" ]; then \
echo "Error: You must provide a migration description using 'm=\"Description\"'"; \
exit 1; \
fi
$(DOCKER_EXEC) $(ALEMBIC_CMD) revision --autogenerate -m "$(m)"
downgrade: ## Revert the last migration
$(DOCKER_EXEC) $(ALEMBIC_CMD) downgrade -1
reset_db: ## Truncate all tables in the database (WARNING: deletes all data)
$(DOCKER_EXEC) uv run python scripts/reset_database.py