-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
102 lines (81 loc) · 2.52 KB
/
justfile
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
default:
echo 'Hello, world!'
install: pip-install git-clone dev-install
alias i := install
dev-install:
dm repo install django-mongodb-backend
dm repo install django-mongodb-extensions
dm repo install mongo-python-driver
demo:
dm repo test django queries_
dm repo test django-filter tests.test_filters
dm repo test django-debug-toolbar
dm repo test django-allauth allauth/account/tests
alias d := demo
# ---------------------------------------- git ----------------------------------------
[group('git')]
git-clone:
dm repo clone django-mongodb-app
dm repo clone django-mongodb-backend
dm repo clone django-mongodb-extensions
dm repo clone django-mongodb-project
dm repo clone django-mongodb-templates
dm repo clone mongo-python-driver
# ---------------------------------------- django ----------------------------------------
[group('django')]
django-open:
open http://localhost:8000
alias o := django-open
[group('django')]
django-runserver:
dm runserver
alias s := django-runserver
[group('django')]
django-migrate:
dm manage migrate
alias m := django-migrate
[group('django')]
django-createsuperuser:
dm createsuperuser
alias su := django-createsuperuser
# ---------------------------------------- mongodb ----------------------------------------
[group('mongodb')]
db-init:
# mongosh `echo ${MONGODB_URI}` --eval 'db.dropDatabase()'
mongosh `echo mongodb://0.0.0.0/backend` --eval 'db.dropDatabase()'
# ---------------------------------------- python ----------------------------------------
# install python dependencies and activate pre-commit hooks
[group('python')]
pip-install: check-venv
brew install libxml2 libxmlsec1 pkg-config
pip install -U pip
pip install -e .
pre-commit install
# ensure virtual environment is active
[group('python')]
check-venv:
#!/bin/bash
PYTHON_PATH=$(which python)
if [[ $PYTHON_PATH == *".venv/bin/python" ]]; then
echo "Virtual environment is active."
else
echo "Virtual environment is not active."
exit 1
fi
[group('npm')]
npm-install:
npm install
# ---------------------------------------- sphinx ----------------------------------------
[group('sphinx')]
sphinx-build:
sphinx-build -b html docs/source docs/_build
alias b := sphinx-build
[group('sphinx')]
sphinx-serve:
# cd docs/_build && python -m http.server
sphinx-autobuild docs/source docs/_build
alias ss := sphinx-serve
[group('sphinx')]
sphinx-clean:
rm -rvf docs/_build
alias sc := sphinx-clean