-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1.2 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
PYTHON_VERSION ?= python3.11
VENV_BIN ?= .venv/bin/
PIP_UPDATE = $(VENV_BIN)pip3 install --upgrade pip
#PIP_OPTIONS ?= --trusted-host pypi.org --trusted-host files.pythonhosted.org --extra-index-url https://test.pypi.org/simple
PIP_CMD ?= $(VENV_BIN)pip3 install ${PIP_OPTIONS} flake8
PACKAGE ?= jura_crdppf
.PHONY: help
help:
@echo "Usage: make <target>"
@echo
@echo "Main targets:"
@echo
@echo "- build Build and configure the project"
@echo "- serve Serve the composition"
@echo "- stop Stop the composition"
@echo "- lint Run Flake8 checker on the Python code"
@echo "- cleanall Remove all the build artefacts"
.PHONY: build
build: .venv/install-timestamp build-print-image
docker compose build
build-print-image:
cd print/docker ; docker build -t sitj/jura-crdppf-print-v2 . ; cd ../..
.venv/timestamp:
python3 -m virtualenv --python=$(PYTHON_VERSION) .venv
touch $@
.venv/install-timestamp: .venv/timestamp
$(PIP_UPDATE)
$(PIP_CMD)
touch $@
.PHONY: serve
serve: build
docker compose up --remove-orphans -d
.PHONY: stop
stop:
docker compose down --remove-orphans
.PHONY: lint
lint: .venv/install-timestamp
$(VENV_BIN)flake8 $(PACKAGE)
.PHONY: cleanall
cleanall: stop
rm -rf .venv