-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 823 Bytes
/
Makefile
File metadata and controls
44 lines (35 loc) · 823 Bytes
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
app=python-service-library
poetry-container=docker run --rm -it \
-w /mnt/app \
-v $(shell pwd):/mnt/app \
-v $(app)-cache:/home/python/.cache \
merrymake/python-poetry
poetry=$(poetry-container) poetry
.PHONY:
build:
docker build -t merrymake/python-poetry .
.PHONY:
run: .install
$(poetry-container) bash
.install:
make install
touch .install
.PHONY:
install:
$(poetry) install
.PHONY:
black: .install
$(poetry) run black ./src/ ./tests/
.PHONY:
publish: .install guard-POETRY_PYPI_TOKEN_PYPI
docker run --rm -it \
-w /mnt/app \
-v $(shell pwd):/mnt/app \
-v $(app)-cache:/home/python/.cache \
-e POETRY_PYPI_TOKEN_PYPI \
merrymake/python-poetry sh -c "poetry build && poetry publish"
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi