Repository navigation
Expand file tree
/
Copy pathtaskfile.yml
More file actions
83 lines (74 loc) · 2.18 KB
/
Copy pathtaskfile.yml
File metadata and controls
83 lines (74 loc) · 2.18 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
73
74
75
76
77
78
79
80
81
82
83
version: "3"
vars:
# Development environment variables
DEV_POSTGRES_HOST: localhost
DEV_POSTGRES_SCHEMA: api
DEV_POSTGRES_DB: my_api_development
DEV_POSTGRES_USER: postgres
DEV_POSTGRES_PASSWORD: postgres
DEV_ENVIRONMENT: development
tasks:
# Environment management tasks
env-dev-start:
desc: "Start local development environment"
cmds:
- echo "Starting local development environment..."
- docker compose up --build --remove-orphans
silent: true
env-dev-stop:
desc: "Stop local development environment"
cmds:
- echo "Stopping local development environment..."
- docker compose down --remove-orphans
silent: true
# Code quality tasks
check:
desc: "Format code and run linting"
cmds:
- echo "Formatting code with black..."
- uv run black .
- echo "Running ruff with auto-fix..."
- uv run ruff check . --fix
silent: true
# Testing tasks
pytest:
desc: "Run unit tests"
cmds:
- uv run pytest "-m not integration"
silent: true
pytest-integration:
desc: "Run integration tests"
cmds:
- uv run pytest "-m integration"
silent: true
ci:
desc: "Run full CI pipeline (format, lint, test)"
cmds:
- task: check
- task: pytest
silent: true
# Migration tasks
migrations-run:
desc: "Run database migrations (development)"
env:
POSTGRES_HOST: "{{.DEV_POSTGRES_HOST}}"
POSTGRES_DB: "{{.DEV_POSTGRES_DB}}"
POSTGRES_SCHEMA: "{{.DEV_POSTGRES_SCHEMA}}"
POSTGRES_USER: "{{.DEV_POSTGRES_USER}}"
POSTGRES_PASSWORD: "{{.DEV_POSTGRES_PASSWORD}}"
ENVIRONMENT: "{{.DEV_ENVIRONMENT}}"
cmds:
- echo "Running development database migrations..."
- uv run alembic upgrade head
silent: true
migrations-downgrade:
desc: "Downgrade database migrations (development)"
env:
POSTGRES_HOST: "{{.DEV_POSTGRES_HOST}}"
POSTGRES_DB: "{{.DEV_POSTGRES_DB}}"
POSTGRES_USER: "{{.DEV_POSTGRES_USER}}"
POSTGRES_PASSWORD: "{{.DEV_POSTGRES_PASSWORD}}"
ENVIRONMENT: "{{.DEV_ENVIRONMENT}}"
cmds:
- echo "Downgrading development database migrations..."
- uv run alembic downgrade -1