Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (53 loc) · 1.87 KB
/
Copy pathMakefile
File metadata and controls
70 lines (53 loc) · 1.87 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
# Letta Telegram Bot - Development & Deployment Commands
.PHONY: help install dev lint format typecheck check poll build up down logs restart
help:
@echo "Available commands:"
@echo " make install - Install dependencies with uv"
@echo " make dev - Install with dev dependencies"
@echo " make lint - Run ruff linter"
@echo " make format - Format code with ruff"
@echo " make typecheck - Run mypy type checker"
@echo " make check - Run format, lint, and typecheck"
@echo " make poll - Run bot in polling mode (local development)"
@echo ""
@echo "Docker commands:"
@echo " make build - Build Docker image"
@echo " make up - Start bot with docker-compose"
@echo " make down - Stop containers"
@echo " make logs - View container logs"
@echo " make restart - Rebuild and restart (pull + build + down + up)"
# Development
install:
uv sync --no-dev
dev:
uv sync --group dev
lint:
uv run ruff check . --fix
format:
uv run ruff format .
typecheck:
uv run mypy .
# lab/ is gitignored, so ruff skips it by default while mypy does not. The
# subproject carries its own gate; run it here too when it is present, or the
# root gate reports green on code it never linted.
check: format lint typecheck
@if [ -d lab ]; then $(MAKE) -C lab check; fi
@echo "All checks passed!"
poll:
uv run python -m letta_bot.main -p
# Docker deployment
build:
docker compose -f deploy/docker-compose.yaml --env-file .env build
up:
docker compose -f deploy/docker-compose.yaml --env-file .env up -d
down:
docker compose -f deploy/docker-compose.yaml --env-file .env down
logs:
docker compose -f deploy/docker-compose.yaml --env-file .env logs -f letta-bot
logs-db:
docker compose -f deploy/docker-compose.yaml --env-file .env logs -f gel
pull:
git pull
r: pull build up
restart: build down up
@echo "Bot restarted successfully"