aboutsummaryrefslogblamecommitdiffstats
path: root/Makefile
blob: 4744c1299be6f8893401567f6d3b5767615d784c (plain) (tree)































                                                                                                                                                                                                                                                        
all: build run migrate collectstatic

start: build run migrate collectstatic

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

push:
	@docker build -f compose/production/django/Dockerfile -t pyblackbird_cc:latest . && docker tag pyblackbird_cc 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 pyblackbird_cc_django --env-file .env -p 8080:8080 pyblackbird_cc

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"