- 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
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import os
|
|
import subprocess
|
|
|
|
|
|
def hard_restart_docker_services(dir_path: str) -> None:
|
|
print(f"Hard restart docker-compose services in: {dir_path}", flush=True)
|
|
subprocess.run(["docker-compose", "down"], cwd=dir_path, check=True)
|
|
subprocess.run(["docker-compose", "up", "-d"], cwd=dir_path, check=True)
|
|
|
|
|
|
def handle_docker_compose_services(parent_directory: str, hard_restart_required: list[str]) -> None:
|
|
for entry in os.scandir(parent_directory):
|
|
if not entry.is_dir():
|
|
continue
|
|
|
|
dir_path = entry.path
|
|
name = os.path.basename(dir_path)
|
|
compose_file = os.path.join(dir_path, "docker-compose.yml")
|
|
|
|
print(f"Checking directory: {dir_path}", flush=True)
|
|
if not os.path.isfile(compose_file):
|
|
print("No docker-compose.yml found. Skipping.", flush=True)
|
|
continue
|
|
|
|
if name in hard_restart_required:
|
|
print(f"{name}: hard restart required.", flush=True)
|
|
hard_restart_docker_services(dir_path)
|
|
else:
|
|
print(f"{name}: no restart required.", flush=True)
|