-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 1.33 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
clean:
@find . -name "*.pyc" -exec rm -rf {} \;
@find . -name "__pycache__" -delete
update_requirements:
pip install -U -q pip-tools
pip-compile --output-file=requirements/base/base.txt requirements/base/base.in
pip-compile --output-file=requirements/test/test.txt requirements/test/test.in
pip-compile --output-file=requirements/dev/dev.txt requirements/dev/dev.in
pip-compile --upgrade --output-file=requirements/deploy/deploy.txt requirements/deploy/deploy.in
install_requirements:
@echo 'Installing pip-tools...'
export PIP_REQUIRE_VIRTUALENV=true; \
pip install -U -q pip-tools
@echo 'Installing requirements...'
pip-sync requirements/base/base.txt requirements/dev/dev.txt requirements/test/test.txt
setup:
@echo 'Setting up the environment...'
make install_requirements
run-tests:
@echo 'Checking for migrations'
python manage.py makemigrations --dry-run | grep 'No changes detected' || (echo 'There are changes which require migrations.' && exit 1)
python manage.py test
dl-db-dump:
@echo 'Downloading new db dump from s3'
export AWS_PROFILE=copwatch
inv aws.configure-eks-kubeconfig
inv staging pod.get-db-dump --db-var=DATABASE_URL_NC
refresh-view:
@echo 'Migrating all databases'
./migrate_all_dbs.sh
@echo 'Refreshing the StopSummary materialized view'
python manage.py refresh_pgviews --database=traffic_stops_nc