-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (32 loc) · 1.61 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
# Global tasks.
# =============================================================================
PYTHON_VERSION := python3.9
.PHONY: shell_on_django_container shell_on_django_container_as_root shell_on_postgres_container
# DOCKER commands
# =============================================================================
# Django
shell_on_django_container:
docker exec -ti bitoubi_django /bin/bash
shell_on_django_container_as_root:
docker exec -ti --user root bitoubi_django /bin/bash
# Postgres
shell_on_postgres_container:
docker exec -ti bitoubi_postgres /bin/bash
# Itou theme
update_itou_theme: scripts/upload_itou_theme.sh
docker exec bitoubi_django /bin/sh -c "./scripts/upload_itou_theme.sh"
# After migrate
populate_db:
pg_restore -d marche --if-exists --clean --no-owner --no-privileges lemarche/perimeters/management/commands/data/perimeters_20220104.sql
ls -d lemarche/fixtures/django/* | xargs django-admin loaddata
populate_db_container:
# docker exec -ti bitoubi_postgres bash -c "pg_restore -d marche --if-exists --clean --no-owner --no-privileges lemarche/perimeters/management/commands/data/perimeters_20220104.sql"
docker exec -ti bitoubi_django bash -c "ls -d lemarche/fixtures/django/* | xargs django-admin loaddata"
# Deployment
# =============================================================================
deploy_prod: scripts/deploy_prod.sh
./scripts/deploy_prod.sh
test_container:
docker exec -ti bitoubi_django django-admin test --settings=config.settings.test $(TARGET) --noinput --failfast --parallel
test:
django-admin test --settings=config.settings.test $(TARGET) --noinput --failfast --parallel