-
Notifications
You must be signed in to change notification settings - Fork 3
/
justfile
122 lines (93 loc) · 2.55 KB
/
justfile
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
site_domain := "localhost:8000"
site_name := "RadioFeed"
admin_username := "admin"
admin_email := "admin@localhost"
@_default:
@just --list
# Install all dependencies
@install: envfile pyinstall precommmitinstall nltkdownload
# Update all dependencies
@update: pyupdate pyinstall precommitupdate
# Run all checks and tests
@check: typecheck templatecheck test precommitall
# Deploy application using Github Actions
@deploy:
gh workflow run deploy_production.yml
# Install all Python dependencies
@pyinstall:
uv sync --frozen --all-extras --no-install-project
# Update all Python dependencies
@pyupdate:
uv lock --upgrade
# Run the Django management command
@dj *ARGS:
uv run python ./manage.py {{ ARGS }}
# Create a superuser
@superuser username=admin_username email=admin_email:
@just dj createsuperuser \
--noinput \
--username="{{ username }}" \
--email="{{ email }}"
# Run the Django development server
@serve:
@just dj tailwind runserver_plus
# Run database migrations
@migrate:
@just dj migrate
# Open the Django shell
@shell:
@just dj shell_plus
# Clear the cache
@clearcache:
@just dj clear_cache
# Validate all templates
@templatecheck:
@just dj validate_templates
# Set the default site name and domain
@defaultsite name=site_name domain=site_domain:
@just dj set_default_site --domain="{{ domain }}" --name="{{ name }}"
# Run unit tests
@test *ARGS:
uv run pytest {{ ARGS }}
# Type check the code
@typecheck *ARGS:
uv run pyright {{ ARGS }}
# Start all Docker services
@up *ARGS:
docker compose up -d {{ ARGS }}
# Stop all Docker services
@down *ARGS:
docker compose down {{ ARGS }}
# Run pre-commit manually
@precommit *ARGS:
uv run --with pre-commit-uv pre-commit {{ ARGS }}
# Install pre-commit hooks
@precommmitinstall:
@just precommit install
@just precommit install --hook-type commit-msg
# Update pre-commit hooks
@precommitupdate:
@just precommit autoupdate
# Re-run pre-commit on all files
@precommitall:
@just precommit run --all-files
# Download NLTK data
@nltkdownload:
uv run xargs -I{} python -c "import nltk; nltk.download('{}')" < ./nltk.txt
# Build local database and add default data
@dbinit:
@just migrate
@just defaultsite
@just superuser
# Delete local database volume
[confirm]
@dbremove:
docker volume rm radiofeed-app_pg_data
# Create a new .env file from .env.example if it doesn't exist
@envfile:
cp -R -u -p .env.example .env
# Remove all untracked files and directories
[confirm]
@clean:
git clean -Xdf
pre-commit uninstall