-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (38 loc) · 1.88 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
build:
docker-compose build
# utilities
# -----------------------------------------------------------------------------
recreatedb:
rm -rf cohen/db.sqlite3 cohen/properties/migrations cohen/core/access/migrations
docker-compose run --rm --user=`id -u` application python manage.py makemigrations core access properties
docker-compose run --rm --user=`id -u` --no-deps application python manage.py makemigrations --empty properties
createsuperuser:
docker-compose run --rm application python manage.py createsuperuser --username admin --email [email protected]
dependencies:
docker-compose run --rm --no-deps application pip list --outdated --format=column
shell:
docker-compose run --rm --no-deps application python manage.py shell
collectstatic:
docker-compose run --rm --no-deps application python manage.py collectstatic --clear --no-input -v 3
migrate:
docker-compose run --rm application python manage.py migrate
# tests and code quality
# -----------------------------------------------------------------------------
test:
docker-compose run --rm application pytest tests
coverage:
docker-compose run --rm application pytest tests --cov=core --cov=properties --cov-fail-under=85 tests
codestyle:
docker-compose run --rm --no-deps application pycodestyle core properties tests --exclude=migrations
# run
# -----------------------------------------------------------------------------
development:
docker-compose stop
docker-compose up -d postgres
docker-compose up nginx
production:
docker-compose stop
docker-compose up -d postgres
docker-compose -f docker-compose.yml -f docker-compose.production.yml run --rm application python manage.py migrate
docker-compose -f docker-compose.yml -f docker-compose.production.yml run --rm --no-deps application python manage.py collectstatic --clear --no-input -v 0
docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d nginx