-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
65 lines (47 loc) · 2.15 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
#!/usr/bin/make
SHELL = /bin/sh
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
export CURRENT_UID
export CURRENT_GID
build_admin:
rm -rf ./public/admin
docker compose -f .docker/admin/docker-compose.yml pull
docker compose -f .docker/admin/docker-compose.yml run --rm admin bash -c "npm ci --legacy-peer-deps && npx react-scripts --openssl-legacy-provider build"
mv ./admin/build ./public/admin
rm -rf ./admin/node_modules
build_front:
docker compose -f .docker/frontend/docker-compose.yml pull
docker compose -f .docker/frontend/docker-compose.yml run --rm front bash -c "git config --global url.\"https://github.com/\".insteadOf ssh://[email protected]/ && npm ci --production && npm run build"
find ./public -maxdepth 1 -type f -exec rm {} \;
if [ -e ./public/static ]; then rm -r ./public/static ./public/images ./public/locales; fi
mv ./front/build/* ./public/
rm -rf ./front/node_modules
build_prod: build_admin
docker pull ubuntu:jammy
docker build -t terra-visu:latest -f .docker/backend/Dockerfile .
messages:
docker compose run --rm web ./manage.py makemessages -a --no-location --no-obsolete
docker compose run --rm web ./manage.py compilemessages
tests:
docker compose run --rm web ./manage.py test -v 3 --settings=project.settings.tests
coverage:
docker compose run --rm web coverage run ./manage.py test -v 3 --settings=project.settings.tests
docker compose run --rm web coverage report -m
sphinx:
docker compose run --workdir=/opt/terra-visu/docs --rm web make html -e SPHINXOPTS="-W"
black:
docker compose run --rm web black project
isort:
docker compose run --rm web isort project
flake8:
docker compose run --rm web flake8 project
lint: black isort flake8
deps:
docker compose run --rm web bash -c "pip-compile --strip-extras && cd docs && pip-compile --strip-extras && cd .. && pip-compile dev-requirements.in"
django:
docker compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
docs_serve:
docker compose run -p 8800:8800 -w=/opt/terra-visu/docs --rm web sphinx-autobuild -c source -b html --host 0.0.0.0 --port 8800 ./source ./build/html
docs_build:
docker compose run -w=/opt/terra-visu/docs --rm web make html