-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
79 lines (60 loc) · 2.08 KB
/
Makefile
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
serve: poetry
docker compose up --pull always --build
clean:
docker rm -f lookit-api-web lookit-api-db lookit-api-broker lookit-api-worker
docker image rm lookit-api_worker lookit-api_web
clean-translations:
find ./locale -name *.mo -exec rm {} \;
migrate:
docker compose run --rm web poetry run ./manage.py migrate
superuser:
docker compose run --rm web poetry run ./manage.py createsuperuser
site: migrate
docker compose run --rm web poetry run python -c \
"import os; \
import django; \
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings'); \
django.setup(); \
from django.contrib.sites.models import Site; \
Site.objects.create(domain='localhost', name='Lookit')"
dbpipe:
docker compose exec -T db psql -U postgres -d lookit
dbshell:
docker compose exec -it db psql -U postgres -d lookit
broker-perms:
docker compose exec -it broker /bin/sh -c \
"rabbitmqctl add_user lookit-admin admin; \
rabbitmqctl set_user_tags lookit-admin administrator; \
rabbitmqctl set_permissions -p / lookit-admin '.*' '.*' '.*'; \
rabbitmq-plugins enable rabbitmq_management; \
rabbitmqadmin declare queue --vhost=/ name=email; \
rabbitmqadmin declare queue --vhost=/ name=builds; \
rabbitmqadmin declare queue --vhost=/ name=cleanup;"
docker compose restart worker
local-certs:
mkdir -p certs
mkcert -install
cd certs && mkcert local_lookit.mit.edu
media:
gsutil -m cp -r "gs://lookit-staging/media" ./project
media-prod:
gsutil -m cp -r "gs://lookit-production/media" ./project
test: poetry
docker compose run --rm -e ENVIRONMENT= web poetry run ./manage.py test --failfast --verbosity 2
collectstatic:
docker compose run --rm web poetry run ./manage.py collectstatic --clear --noinput
poetry:
poetry check
poetry self update
poetry env use 3.9
poetry install --sync --no-root
lint: poetry
poetry run pre-commit run --all-files
css: poetry
poetry run ./manage.py custom_bootstrap5
makemigrations:
poetry run ./manage.py makemigrations
makemessages:
poetry run ./manage.py makemessages --all
compilemessages:
poetry run ./manage.py compilemessages