forked from mPowering/django-orb
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (58 loc) · 2.49 KB
/
Makefile
File metadata and controls
83 lines (58 loc) · 2.49 KB
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
.PHONY: deps python-deps test test-django lint database help docs
###################################
### Dependency building
deps: python-deps
python-deps: ## Install all dependencies, for running app, dev, and testing
pip install -r requirements/frozen.txt
pip install -r requirements/test.txt
vue-deps: ## Install front-end dependencies
cd ./vue && yarn install
###################################
### Testing
test: test-django lint ## Run Django tests and flake8
test-django: ## Run Django tests
pytest
test-fast: ## Run Django tests without search dependencies
pytest -m "not solr"
lint: ## Run flake8 over app
flake8 orb
vue-test: ## Run front-end JS tests
cd ./vue && yarn run unit
vue-test-dev: ## Run front-end JS tests
cd ./vue && yarn run unit-dev
###################################
### Docker shortcuts
run: ## Runs the dev containers
docker-compose -f dev.yml up
build-docker: ## Builds all available containers
docker-compose -f dev.yml build
test-docker: ## Runs tests in the Django container
docker-compose -f dev.yml run django pytest
###################################
### Language
makemessages: ## Make PO messages files
./manage.py makemessages -l es -l pt_BR
register-languages: ## Make migrations for new translated fields, migrate, and update fields
./manage.py makemigrations
./manage.py migrate
./manage.py update_translation_fields
###################################
### Building project components
clean: ## Removes extraneous files and build artifacts
-@find . -name '*.pyc' -follow -print0 | xargs -0 rm -f &> /dev/null
-@find . -name '*.pyo' -follow -print0 | xargs -0 rm -f &> /dev/null
-@find . -name '__pycache__' -type d -follow -print0 | xargs -0 rm -rf &> /dev/null
build: python-deps node-deps database templates docs ## Run all build commands, including dependencies, database, assets, and docs
docs: ## Rebuild the documentation and open in default browser
cd docs && make html
@echo "\033[95m\n\nBuild successful! View the docs homepage at docs/_build/html/index.html.\n\033[0m"
open docs/_build/html/index.html
database: ## Migrate the database
@echo "Setting up and updating the database..."
./manage.py migrate --noinput
help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
vue-dev: ## run vue compiler in dev version
cd ./vue && env=dev ./build.sh
vue-build: ## run vue compiler for production
cd ./vue && env=production ./build.sh