mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2025-12-27 11:06:35 +00:00
- Replace legacy standalone scripts with a proper src-layout Python package (baudolo backup/restore/configure entrypoints via pyproject.toml) - Remove old scripts/files (backup-docker-to-local.py, recover-docker-from-local.sh, databases.csv.tpl, Todo.md) - Add Dockerfile to build the project image for local/E2E usage - Update Makefile: build image and run E2E via external runner script - Add scripts/test-e2e.sh: - start DinD + dedicated network - recreate DinD data volume (and shared /tmp volume) - pre-pull helper images (alpine-rsync, alpine) - load local baudolo:local image into DinD - run unittest E2E suite inside DinD and abort on first failure - on failure: dump host+DinD diagnostics and archive shared /tmp into artifacts/ - Add artifacts/ debug outputs produced by failing E2E runs (logs, events, tmp archive) https://chatgpt.com/share/694ec23f-0794-800f-9a59-8365bc80f435
41 lines
1.3 KiB
Makefile
41 lines
1.3 KiB
Makefile
.PHONY: install build test-e2e
|
|
|
|
# Default python if no venv is active
|
|
PY_DEFAULT ?= python3
|
|
|
|
IMAGE_NAME ?= baudolo
|
|
IMAGE_TAG ?= local
|
|
IMAGE := $(IMAGE_NAME):$(IMAGE_TAG)
|
|
|
|
install:
|
|
@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
|