2025-12-26 18:13:26 +01:00
|
|
|
.PHONY: install build test-e2e
|
2025-07-14 18:47:25 +02:00
|
|
|
|
2025-12-26 18:13:26 +01:00
|
|
|
# Default python if no venv is active
|
|
|
|
|
PY_DEFAULT ?= python3
|
|
|
|
|
|
|
|
|
|
IMAGE_NAME ?= baudolo
|
|
|
|
|
IMAGE_TAG ?= local
|
|
|
|
|
IMAGE := $(IMAGE_NAME):$(IMAGE_TAG)
|
2025-09-11 20:45:30 +02:00
|
|
|
|
|
|
|
|
install:
|
2025-12-26 18:13:26 +01:00
|
|
|
@set -eu; \
|
|
|
|
|
PY="$(PY_DEFAULT)"; \
|
|
|
|
|
if [ -n "$${VIRTUAL_ENV:-}" ] && [ -x "$${VIRTUAL_ENV}/bin/python" ]; then \
|
|
|
|
|
PY="$${VIRTUAL_ENV}/bin/python"; \
|
|
|
|
|
fi; \
|
|
|
|
|
echo ">>> Using python: $$PY"; \
|
|
|
|
|
"$$PY" -m pip install --upgrade pip; \
|
|
|
|
|
"$$PY" -m pip install -e .; \
|
|
|
|
|
command -v baudolo >/dev/null 2>&1 || { \
|
|
|
|
|
echo "ERROR: baudolo not found on PATH after install"; \
|
|
|
|
|
exit 2; \
|
|
|
|
|
}; \
|
|
|
|
|
baudolo --help >/dev/null 2>&1 || true
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# Build the baudolo Docker image
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
build:
|
|
|
|
|
@echo ">> Building Docker image $(IMAGE)"
|
|
|
|
|
docker build -t $(IMAGE) .
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# Run E2E tests inside the container (Docker socket required)
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# E2E via isolated Docker-in-Docker (DinD)
|
|
|
|
|
# - depends on local image build
|
|
|
|
|
# - starts a DinD daemon container on a dedicated network
|
|
|
|
|
# - loads the freshly built image into DinD
|
|
|
|
|
# - runs the unittest suite inside a container that talks to DinD via DOCKER_HOST
|
|
|
|
|
test-e2e: build
|
|
|
|
|
@bash scripts/test-e2e.sh
|