aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: de27106f884484a300fdb93e54c2550491710095 (plain) (blame)
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
all: build run migrate collectstatic

start: build run migrate collectstatic

sass:
	sass --no-source-map ~/code/python/alphabetlearning/alphabetlearning/static/scss/custom.scss ~/code/python/alphabetlearning/alphabetlearning/static/css/custom.css

sync-env:
	scp .env-prod substracker-web:code/alphabetlearning/.env

build:
	@docker build -f compose/production/django/Dockerfile -t alphabetlearning:latest .

push:
	@docker build -f compose/production/django/Dockerfile -t alphabetlearning:latest . && docker tag alphabetlearning registry.digitalocean.com/twentyfour-registry/pyblackbird && docker push registry.digitalocean.com/twentyfour-registry/pyblackbird

clean-registry:
	@doctl registry garbage-collection start --include-untagged-manifests twentyfour-registry

run:
	@docker run -d --rm --name alphabetlearning_django --env-file .env -p 8080:8080 alphabetlearning

collectstatic:
	@docker run --rm --env-file .env -v .:/app pyblackbird sh -c "python manage.py collectstatic --noinput"

migrate:
	@docker run --rm --env-file .env -v .:/app pyblackbird sh -c "python manage.py makemigrations && python manage.py migrate"

clean:
	@docker stop pyblackbird
	@sleep 2
	@docker rmi pyblackbird

test-all:
	@pytest -q -s .

test:
	@pytest -q -s -m "not slow"