-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
66 lines (54 loc) · 1.74 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
.PHONY: all test clean
all test clean:
.PHONY: install-poetry
install-poetry:
pip install -U pip pipx
pipx install poetry
.PHONY: venv
venv:
poetry lock
poetry install --with dev
.PHONY: poetry-plugins
poetry-plugins:
poetry self add "poetry-dynamic-versioning[plugin]"; \
poetry self add "poetry-plugin-export";
.PHONY: setup
setup: install-poetry poetry-plugins venv
poetry run pre-commit install
.PHONY: lint
lint:
poetry run pre-commit run --all-files
poetry run mypy
.python-version:
@echo "Error: .python-version file is missing!" && exit 1
.PHONY: docker_build
docker_build: .python-version dist
PY_VERSION=$$(cat .python-version) && \
docker build -t platformregistryapi:latest --build-arg PY_VERSION=$$PY_VERSION .
.PHONY: build_up
build_up: docker_build
docker compose --project-directory=`pwd` -f tests/docker/docker-compose.yaml up
.PHONY: dist
dist:
rm -rf build dist; \
poetry export -f requirements.txt --without-hashes -o requirements.txt; \
poetry build -f wheel; \
.PHONY: test_unit
test_unit:
poetry run pytest -vv tests/unit
.PHONY: test_integration
test_integration: docker_build
docker compose -f tests/docker/docker-compose.yaml pull -q; \
docker compose --project-directory=`pwd` -f tests/docker/docker-compose.yaml up -d; \
poetry run pytest -vv tests/integration; \
exit_code=$$?; \
docker compose -f tests/docker/docker-compose.yaml kill; \
docker compose -f tests/docker/docker-compose.yaml rm -f; \
exit $$exit_code
test_e2e: docker_build
docker compose --project-directory=`pwd` -f tests/docker/docker-compose.yaml up -d registry; \
tests/e2e/tests.sh; \
exit_code=$$?; \
docker compose -f tests/docker/docker-compose.yaml kill; \
docker compose -f tests/docker/docker-compose.yaml rm -f; \
exit $$exit_code