mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
The env.development marker file existed for two purposes that no longer justify the wiring cost: a per-machine compose --env-file override layer appended after auto-loaded .env, and a fallback signal for detect_runtime() to return "dev" when the marker exists. With every INFINITO_* default now collapsed into env/default.env -> .env, persistent per-machine overrides are best expressed as \`export INFINITO_FOO=…\` before invoking make (load.sh honors caller-set values via setdefault). The marker fallback in detect_runtime was redundant with the explicit RUNTIME=dev that every dev-flow callsite already passes (fresh-*.sh, reset/inventory.sh). Removed: - Makefile mark-development target + .PHONY entry - env.development from .gitignore / .dockerignore - env_local conditional in compose.up() - env_development conditional in down._compose_run() - env.development conditional in scripts/meta/resolve/apps.sh and scripts/meta/resolve/diff/affected_roles.sh - env.development marker branch + the now-unused project_root parameter from cli/meta/runtime/detect_runtime; __main__.py caller follows - "Optional Development Marker" section in docs/contributing/environment/ setup.md and the marker reference in docs/administration/installation.md Also drops two RUNTIME=='dev' guards in roles/web-app-bigbluebutton that relied on the auto-detect path: - the compose build etherpad task in tasks/02_compose.yml - the freeswitch iptables-REJECT entrypoint override in templates/compose.override.yml.j2 With auto-detection of "dev" gone the guards would otherwise only fire on explicit RUNTIME=dev runs, silently regressing the local-dev path operators rely on; both behaviors now apply unconditionally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
52 lines
1.0 KiB
Python
52 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
|
|
from . import PROJECT_ROOT, detect_runtime
|
|
|
|
|
|
def _build_parser() -> argparse.ArgumentParser:
|
|
p = argparse.ArgumentParser(
|
|
prog="python -m cli.meta.runtime",
|
|
description="Detect and print the current Infinito runtime environment.",
|
|
)
|
|
|
|
p.add_argument(
|
|
"--print-root",
|
|
action="store_true",
|
|
help="Also print the detected project root.",
|
|
)
|
|
|
|
p.add_argument(
|
|
"--json",
|
|
action="store_true",
|
|
help="Print result as JSON object.",
|
|
)
|
|
|
|
return p
|
|
|
|
|
|
def main() -> int:
|
|
parser = _build_parser()
|
|
args = parser.parse_args()
|
|
|
|
runtime = detect_runtime()
|
|
|
|
if args.json:
|
|
payload = {
|
|
"runtime": runtime,
|
|
"project_root": str(PROJECT_ROOT),
|
|
}
|
|
print(json.dumps(payload, indent=2))
|
|
else:
|
|
print(runtime)
|
|
if args.print_root:
|
|
print(f"project_root={PROJECT_ROOT}")
|
|
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|