forked from code4romania/war-taskforce-oncologie-pediatrica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (47 loc) · 3.11 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
help: ## Display a help message detailing commands and their purpose
@echo "Commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo ""
build: ## builds the container
docker-compose build --pull
build-dev: ## builds the container with the development flag
docker-compose build --build-arg ENVIRONMENT=development --pull
run:
docker-compose up
run-d:
docker-compose up -d
seed_superuser: ## creates a superuser for the APP based on the data in the .env file
docker-compose exec oncoped ./manage.py seed_superuser
seed_groups: ## creates a groups for the APP based on the data in the .env file
docker-compose exec oncoped ./manage.py seed_groups
seed_email_templates: ## creates initial email templates for notifications
docker-compose exec oncoped ./manage.py seed_email_templates
replace_email_templates: ## replaces initial email templates for notifications
docker-compose exec oncoped ./manage.py seed_email_templates --replace
seed: seed_superuser seed_groups seed_email_templates
drop-db: ## drops the database
docker-compose down -t 60
docker volume rm oncoped-pgdata
## [UTILS]
requirements-build: ## run pip compile and add requirements from the *.in files
docker-compose run --rm --no-deps --entrypoint "bash -c" oncoped "cd /code && pip-compile -o requirements.txt requirements.in && pip-compile -o requirements-dev.txt requirements-dev.in"
requirements-update: ## run pip compile and rebuild the requirements files
docker-compose run --rm --no-deps --entrypoint "bash -c" oncoped "cd /code && pip-compile -r -U -o requirements.txt requirements.in && pip-compile -r -U -o requirements-dev.txt requirements-dev.in && chmod a+r requirements.txt && chmod a+r requirements-dev.txt"
migrations: ## generate migrations in a clean container
docker-compose exec oncoped ./manage.py makemigrations
migrate: ## apply migrations in a clean container
docker-compose exec oncoped ./manage.py migrate
makemessages: ## generate the strings marked for translation
docker-compose exec oncoped ./manage.py makemessages -a
compilemessages: ## compile the translations
docker-compose exec oncoped ./manage.py compilemessages
collectstatic:
docker-compose exec oncoped ./manage.py collectstatic --no-input
css-live:
npx tailwindcss -i ./oncoped/static_custom/src/main.css -o ./oncoped/static_custom/static/site/css/main.css --watch
css:
npx tailwindcss -i ./oncoped/static_custom/src/main.css -o ./oncoped/static_custom/static/site/css/main.css -m
format:
docker-compose run --rm --no-deps --entrypoint "bash -c" oncoped "isort --skip migrations . && black --target-version=py39 --exclude migrations ."
format-check:
docker-compose run --rm --no-deps --entrypoint "bash -c" oncoped "isort --skip migrations --check . && black --target-version=py39 --check --diff --exclude migrations ."