-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
executable file
·69 lines (52 loc) · 1.83 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
66
67
68
69
SHELL := /bin/bash
PROJECT = wordbank
githooks:
git config core.hooksPath .githooks
ci-test:
python manage.py collectstatic --noinput
set -o pipefail ; pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov= | tee pytest-coverage.txt
test:
DEPLOY_ENV=test python manage.py collectstatic --noinput
DEPLOY_ENV=test pytest
lint:
flake8
black --check
cleanup:
black .
isort
db-setup:
docker-compose exec -it db bash
mysql -U root -p poiuytre12
CREATE DATABASE wordbank;
CREATE USER "wordbankadmin" IDENTIFIED BY '4PBNjG37y7Mk83';
GRANT ALL PRIVILEGES on *.* to 'wordbankadmin';
exit;
db-populate-db:
docker-compose exec web python manage.py collectstatic --no-input
docker-compose exec web python manage.py 01_populate_caregiver_education
docker-compose exec web python manage.py 02_create_instrument_schemas
docker-compose exec web python manage.py 03_populate_instrument
docker-compose exec web python manage.py 04_populate_category
docker-compose exec web python manage.py 05_populate_items
docker-compose exec web python manage.py 06_populate_datasets
docker-compose exec web python manage.py 07_import_datasets
docker-compose exec web python manage.py 08_populate_vocabulary_size
docker-test:
docker-compose run test manage.py collectstatic --noinput
docker-compose run test pytest
docker-lint:
docker-compose run web flake8
docker-compose run web black --check
docker-cleanup:
docker-compose run web black
docker-compose run web isort -rc
make sync-dev-db::
ssh giant-dev mysql:export develop-${PROJECT} > mydump.sql
cat mydump.sql | docker-compose exec -T db mysql -pgiant ${PROJECT}
rm mydump.sql
make sync-media::
rsync -rvz live:/var/lib/dokku/data/storage/live-${PROJECT}/media ./media/
make dev-deploy::
git push dokku-dev develop:main
make live-deploy::
git push dokku main:main