-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
37 lines (32 loc) · 976 Bytes
/
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
CONTAINER_NAME:=coronavirus-covid-19-visualization-prediction
TAG:=$(shell git log -1 --pretty=format:"%H")
.PHONY: build
build: ## Build the docker image.
docker build \
$(CACHE_FROM) \
--build-arg VERSION=$(TAG) \
-t $(CONTAINER_NAME) .
.PHONY: run
run: ## Run the service using docker-compose.
docker-compose stop
docker-compose run --rm coronavirus-visualization bash -c "poetry run jupyter lab --allow-root"
.PHONY: lock-dependencies
lock-dependencies: ## Lock poetry dependencies.
docker run \
-v `pwd`:/app \
-it $(CONTAINER_NAME) poetry lock
.PHONY: lint
lint: ## Run service linting.
docker run \
-v $(shell pwd)/src:/app/src \
-v $(shell pwd)/.pylintrc:/app/.pylintrc \
$(CONTAINER_NAME) \
poetry run pylint /app/src
PHONY: debug
debug: test-clean ## Run service unit tests.
docker run \
-e COVERAGE_FILE=/app/tests/.coverage \
-v $(shell pwd):/app \
-ti \
$(CONTAINER_NAME) \
/bin/bash -c "poetry run pytest ${test_dir} -s -v"