05ae530442
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Reconfigure one harness without reinstalling/restarting services or deleting login."""
|
|
import importlib.util
|
|
from pathlib import Path
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def module(name, file):
|
|
spec = importlib.util.spec_from_file_location(name, Path(__file__).with_name(file))
|
|
result = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(result)
|
|
return result
|
|
|
|
|
|
setup_docker = module("setup_docker", "setup-docker.py")
|
|
|
|
|
|
def main():
|
|
root = Path(__file__).resolve().parents[1]
|
|
if len(sys.argv) < 2 or sys.argv[1] not in ("opencode", "pi"):
|
|
sys.exit("Usage: setup-harness.py opencode|pi [harness setup options]")
|
|
name = sys.argv[1]
|
|
settings = root / ".env"
|
|
docker = settings.is_file() and "PIPELINES_HOST_REPOSITORY=" in settings.read_text()
|
|
if not docker:
|
|
sys.exit("Docker installation is not configured. Run ./install first; harness setup does not fall back to a host runtime.")
|
|
installer = setup_docker.Setup(root)
|
|
installer.reconfigure_harness(name, sys.argv[2:])
|
|
installer.link_host(name)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
main()
|
|
except KeyboardInterrupt:
|
|
sys.exit(130)
|
|
except (ValueError, KeyError, OSError, subprocess.CalledProcessError) as error:
|
|
sys.exit(f"Harness setup incomplete; existing credentials retained: {error}")
|