mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
- Add build-context helper to copy Docker context safely (ignore runtime data, keep symlinks) - Update UI and core actions to use ~/.prole/build and shared copy helper - Add/adjust tests and scripts; introduce knoe ops helpers and update manifests Co-authored-by: Junie <junie@jetbrains.com>
30 lines
726 B
Python
30 lines
726 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from dataclasses import dataclass, field
|
|
from pathlib import Path
|
|
from typing import Callable
|
|
|
|
|
|
def _default_logger(msg: str) -> None:
|
|
print(msg)
|
|
|
|
|
|
def _default_err_logger(msg: str) -> None:
|
|
print(msg, file=sys.stderr)
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class KnoeContext:
|
|
"""Small shared context object for Stage 1 ops modules."""
|
|
|
|
project_root: Path
|
|
cfg_path: Path | None = None
|
|
mode: str = "dev"
|
|
namespace: str = "default"
|
|
service_namespace: str = "default"
|
|
env: dict[str, str] = field(default_factory=lambda: dict(os.environ))
|
|
logger: Callable[[str], None] = _default_logger
|
|
err_logger: Callable[[str], None] = _default_err_logger
|