f5091d0903
Phase A4 of plans/implementation-plan-A-B.md. Implements the full job orchestrator (clone -> start -> wait -> probe -> build -> collect -> guaranteed cleanup) as a new commands/job.py click command, registered under python -m ci_orchestrator job. Backend selection goes through backends.load_backend(config) so Phase C can swap in remote drivers without touching the command. The legacy scripts/Invoke-CIJob.ps1 is replaced by a thin PS 5.1 shim that delegates to the Python CLI; tests/python/test_commands_job.py adds 13 cases covering Linux/Windows happy paths, override application, skip-artifact, and cleanup on every failure mode.
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
"""CLI entry point.
|
|
|
|
Phase A2 ships ``wait-ready``, ``vm`` (remove/cleanup), ``monitor``
|
|
(disk/runner) and ``report`` (job). Phase A3 adds ``vm new``, ``build``,
|
|
``artifacts``. Subsequent phases add ``job``.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import time as time
|
|
|
|
import click
|
|
|
|
from ci_orchestrator import __version__
|
|
from ci_orchestrator.commands.artifacts import artifacts
|
|
from ci_orchestrator.commands.build import build
|
|
from ci_orchestrator.commands.job import job
|
|
from ci_orchestrator.commands.monitor import monitor
|
|
from ci_orchestrator.commands.report import report
|
|
from ci_orchestrator.commands.vm import vm
|
|
|
|
# Re-export so legacy A1 tests that patched ``cli_module.<name>`` keep working.
|
|
from ci_orchestrator.commands.wait import ( # noqa: F401 (intentional re-exports)
|
|
KeyringCredentialStore,
|
|
SshTransport,
|
|
WinRmTransport,
|
|
load_backend,
|
|
wait_ready,
|
|
)
|
|
|
|
|
|
@click.group()
|
|
@click.version_option(__version__, prog_name="ci-orchestrator")
|
|
def cli() -> None:
|
|
"""Local CI/CD orchestrator."""
|
|
|
|
|
|
cli.add_command(wait_ready)
|
|
cli.add_command(vm)
|
|
cli.add_command(build)
|
|
cli.add_command(artifacts)
|
|
cli.add_command(monitor)
|
|
cli.add_command(report)
|
|
cli.add_command(job)
|
|
|
|
|
|
if __name__ == "__main__": # pragma: no cover
|
|
cli()
|