This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
56 lines (41 loc) · 1.51 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
PYTHON := env/bin/python
PIP := env/bin/pip
PYLINT := env/bin/pylint
.PHONY: cleanenv devenv prodenv test watch runmigrations runlint
.IGNORE: runlint
cleanenv:
@echo 'Cleaning environment....'
rm -rf env/ && rm -rf wellregistry/wellregistry/staticfiles && rm -rf wellregistry/node_modules
watch:
$(PYTHON) wellregistry/manage.py runserver
devenv: env common-env-requirements local-dev-requirements env-static wellregistry/.env
prodenv: env common-env-requirements prod-requirements env-static wellregistry/.env
test:
cd wellregistry && ../$(PYTHON) manage.py test
runmigrations:
$(PYTHON) wellregistry/manage.py migrate admin
$(PYTHON) wellregistry/manage.py migrate auth
$(PYTHON) wellregistry/manage.py migrate contenttypes
$(PYTHON) wellregistry/manage.py migrate sessions
$(PYTHON) wellregistry/manage.py migrate social_django
$(PYTHON) wellregistry/manage.py migrate registry
$(PYTHON) wellregistry/manage.py update_lookups
runlint:
$(PYLINT) wellregistry/registry
$(PYLINT) wellregistry/wellregistry/
env-static:
@echo "Installing node modules"
cd wellregistry && npm install && cd ../
env:
@echo 'Creating local environment....'
virtualenv --python=python3.8 --no-download env
$(PIP) install --upgrade pip
common-env-requirements:
$(PIP) install -r requirements.txt
wellregistry/.env:
@echo 'Creating environment variables file'
cp wellregistry/.env.sample wellregistry/.env
local-dev-requirements:
$(PIP) install -r requirements-dev.txt
prod-requirements:
$(PIP) install -r requirements-prod.txt