-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (64 loc) · 1.57 KB
/
Makefile
File metadata and controls
82 lines (64 loc) · 1.57 KB
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
74
75
76
77
78
79
80
81
82
.PHONY: all test clean
all test clean:
.PHONY: venv
venv:
poetry lock
poetry install --with dev;
.PHONY: build
build: venv poetry-plugins
.PHONY: poetry-plugins
poetry-plugins:
poetry self add "poetry-dynamic-versioning[plugin]"; \
poetry self add "poetry-plugin-export";
.PHONY: setup
setup: venv
poetry run pre-commit install;
.PHONY: lint
lint: format
poetry run mypy
.PHONY: format
format:
ifdef CI
poetry run pre-commit run --all-files --show-diff-on-failure
else
poetry run pre-commit run --all-files
endif
.PHONY: test_unit
test_unit:
poetry run pytest -vv tests/unit
.PHONY: test_integration
test_integration:
poetry run pytest -vv tests/integration
.PHONY: clean-dist
clean-dist:
rm -rf dist
IMAGE_NAME = platformstorageapi
.PHONY: build/image
build/image: dist
docker build \
--build-arg PY_VERSION=$$(cat .python-version) \
-t $(IMAGE_NAME):latest .
.python-version:
@echo "Error: .python-version file is missing!" && exit 1
.PHONY: dist
dist: build
rm -rf build dist; \
poetry export -f requirements.txt --without-hashes -o requirements.txt; \
poetry build -f wheel;
.PHONY: build/test-image
build/test-image: dist
docker build \
--build-arg PY_VERSION=$$(cat .python-version) \
-t admission-controller-tests:latest .
.PHONY: docker_pull_test_images
docker_pull_test_images:
ifeq ($(MINIKUBE_DRIVER),none)
make _docker_pull_test_images
else
@eval $$(minikube docker-env); \
make _docker_pull_test_images
endif
.PHONY: _docker_pull_test_images
_docker_pull_test_images:
docker pull ghcr.io/neuro-inc/admission-controller-lib:latest; \
include k8s.mk