-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
69 lines (56 loc) · 1.63 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
SHELL = /bin/bash -eux
ENVOY_VERSION := v1.25.3
IMAGE_TAG := any
export IMAGE_TAG
clean:
docker compose kill
docker compose down
docker compose rm -f
build:
# Build containers
IMAGE_TAG=$(ENVOY_VERSION) \
docker compose build envoy sovereign
lint:
poetry run poe lint
poetry run black src/sovereign
poetry run mypy src/sovereign
run: build
IMAGE_TAG=$(ENVOY_VERSION) \
docker compose up \
$(ENVOY_CTRLPLANE_DAEMON) \
envoy sovereign redis
run-daemon:
ENVOY_CTRLPLANE_DAEMON='-d' make run
run-ctrl: clean
docker compose up --build $(ENVOY_CTRLPLANE_DAEMON) sovereign
acceptance:
mkdir -p test-reports
docker compose build tavern-acceptance
docker compose run --rm tavern-acceptance
unit:
mkdir -p test-reports
docker compose build tavern-unit
docker compose run --rm -e SOVEREIGN_CONFIG=file://test/config/config.yaml tavern-unit
install-deps:
poetry install
poetry install -E ujson -E orjson -E caching -E httptools
poetry config cache-dir "~/.cache/pip"
release: check_version
poetry build
poetry publish -u $(TWINE_USERNAME) -p $(TWINE_PASSWORD)
test-envoy-version:
mkdir -p logs
IMAGE_TAG=$(ENVOY_VERSION) \
PYTEST_MARK=`echo $(ENVOY_VERSION) | tr . _` \
make run-daemon acceptance
check_version:
@package_version=$$(poetry version | awk '{print $$2}'); \
git_tag=$$(git describe --tags --exact-match 2>/dev/null || echo ""); \
if [ "$$package_version" = "$$git_tag" ]; then \
echo "Package version and Git tag match: $$package_version"; \
else \
echo "Package version ($$package_version) and Git tag ($$git_tag) do not match"; \
exit 1; \
fi
.PHONY: clean up test release
test: unit test-envoy-version clean