refactor: migrate to src/ package + add DinD-based E2E runner with debug artifacts
- 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
This commit is contained in:
29
src/baudolo/restore/paths.py
Normal file
29
src/baudolo/restore/paths.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class BackupPaths:
|
||||
volume_name: str
|
||||
backup_hash: str
|
||||
version: str
|
||||
repo_name: str
|
||||
backups_dir: str = "/Backups"
|
||||
|
||||
def root(self) -> str:
|
||||
# Always build an absolute path under backups_dir
|
||||
return os.path.join(
|
||||
self.backups_dir,
|
||||
self.backup_hash,
|
||||
self.repo_name,
|
||||
self.version,
|
||||
self.volume_name,
|
||||
)
|
||||
|
||||
def files_dir(self) -> str:
|
||||
return os.path.join(self.root(), "files")
|
||||
|
||||
def sql_file(self, db_name: str) -> str:
|
||||
return os.path.join(self.root(), "sql", f"{db_name}.backup.sql")
|
||||
Reference in New Issue
Block a user