-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
73 lines (59 loc) · 1.72 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# variables
POETRY_RUN := poetry run
PRE_COMMIT_CMD := $(POETRY_RUN) pre-commit
MERMAID_INK_CONTAINER := ghcr.io/jihchi/mermaid.ink
.PHONY: install
install:
poetry install
.PHONY: update
update:
poetry update
.PHONY: build
build:
poetry build
.PHONY: publish
publish:
poetry publish
.PHONY: test
test:
$(POETRY_RUN) pytest
.PHONY: install/pre-commit
install/pre-commit:
$(PRE_COMMIT_CMD) uninstall && $(PRE_COMMIT_CMD) install
.PHONY: lint
lint:
$(PRE_COMMIT_CMD) run --all-files
.PHONY: coverage
coverage:
$(POETRY_RUN) pytest --cov ./mermaid --cov-report=xml
.PHONY: mermaid.ink/up
mermaid.ink/up:
docker run -p 3000:3000 -d --cap-add=SYS_ADMIN $(MERMAID_INK_CONTAINER)
.PHONY: mermaid.ink/down
mermaid.ink/down:
docker stop $(shell docker ps -q --filter ancestor=$(MERMAID_INK_CONTAINER))
.PHONY: bumpversion
bumpversion:
$(eval name=$(filter-out $@,$(MAKECMDGOALS)))
$(POETRY_RUN) bumpver update --$(name)
%:
@:
.PHONY: help
help:
@echo "run 'make <target>' where <target> is one of the following:"
@echo ""
@echo " install install dependencies"
@echo " update update dependencies"
@echo " build build package"
@echo " publish publish package"
@echo ""
@echo " test run tests"
@echo " install/pre-commit install pre-commit hooks"
@echo " lint run linters"
@echo " coverage run tests with coverage"
@echo ""
@echo " bumpversion bump version"
@echo " help show this help message"
@echo ""
@echo " mermaid.ink/up start mermaid.ink Local server"
@echo " mermaid.ink/down stop mermaid.ink local server"