-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (44 loc) · 1.17 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
PROJECT_NAME = egsis
DOCKER_REGISTRY := ryukinix/egsis
VERSION := latest
UID = $(shell id -u)
GID = $(shell id -g)
DOCKER = docker
ifeq ($(DOCKER), podman)
DOCKER_FLAGS=--userns keep-id
else
DOCKER_FLAGS=
endif
DOCKER_RUN = $(DOCKER) run $(DOCKER_FLAGS) \
--user $(UID):$(GID) \
-e HOME=/tmp --rm \
-t \
-v $(PWD)/tests:/app/tests \
-w /app
MOUNT_NOTEBOOK = -v $(PWD)/notebooks:/app/notebooks
EXPOSE_PORT = --net=host
install: # install locally
python -m venv .venv
source .venv/bin/activate
pip install -U pdm setuptools wheel
pdm install
run: build
$(DOCKER_RUN) $(PROJECT_NAME)
pull:
$(DOCKER) pull $(DOCKER_REGISTRY)
build:
$(DOCKER) build -t $(PROJECT_NAME) .
publish: build
$(DOCKER) tag $(PROJECT_NAME) $(DOCKER_REGISTRY):$(VERSION)
$(DOCKER) push $(DOCKER_REGISTRY):$(VERSION)
check: build
$(DOCKER_RUN) $(PROJECT_NAME) check
sed -i "s|/app|$(PWD)|g" tests/coverage.xml
lint: build
$(DOCKER_RUN) $(PROJECT_NAME) lint egsis/ tests/
notebook: build
$(DOCKER_RUN) -i $(MOUNT_NOTEBOOK) $(EXPOSE_PORT) $(PROJECT_NAME) jupyter lab
coverage:
coverage html
open htmlcov/index.html
.PHONY: build run pull check lint coverage notebook install