cli.deploy.container package

Submodules

cli.deploy.container.command module

cli.deploy.container.command.docker_exec(container: str, args: List[str], check: bool = True) CompletedProcess

Helper to run docker exec with optional working directory.

cli.deploy.container.command.ensure_image(image: str, rebuild: bool = False, no_cache: bool = False) None
Handle Docker image creation rules:
  • rebuild=True => always rebuild

  • rebuild=False & image missing => build once

  • no_cache=True => add ‘–no-cache’ to docker build

cli.deploy.container.command.exec_in_container(name: str, cmd_args: List[str]) int
cli.deploy.container.command.main() int
cli.deploy.container.command.remove_container(name: str) None
cli.deploy.container.command.run_in_container(image: str, build: bool, rebuild: bool, no_cache: bool, inventory_args: List[str], deploy_args: List[str], name: str | None = None) None
Full CI “run” mode:
  • start CI container (host docker socket mode)

  • run cli.create.inventory (with forwarded inventory_args)

  • ensure CI vault password file

  • run cli.deploy.dedicated (with forwarded deploy_args)

  • always remove container at the end

cli.deploy.container.command.split_inventory_and_deploy_args(rest: List[str]) Tuple[List[str], List[str]]
Split remaining arguments into:
  • inventory_args: passed to cli.create.inventory

  • deploy_args: passed to cli.deploy.dedicated

Convention:
  • [inventory-args …] – [deploy-args …]

  • If no ‘–’ is present: inventory_args = [], deploy_args = all rest.

cli.deploy.container.command.start_ci_container(image: str, build: bool, rebuild: bool, no_cache: bool, name: str | None = None) str

Start a CI container that uses the host Docker socket (no Docker-in-Docker).

Returns the container name.

cli.deploy.container.command.stop_container(name: str) None
cli.deploy.container.command.wait_for_docker_socket(container: str, timeout: int = 60) None

Ensure Docker CLI exists in the container and the host docker socket is usable.

Module contents

cli.deploy.container.main() int
cli.deploy.container.remove_container(name: str) None
cli.deploy.container.run_in_container(image: str, build: bool, rebuild: bool, no_cache: bool, inventory_args: List[str], deploy_args: List[str], name: str | None = None) None
Full CI “run” mode:
  • start CI container (host docker socket mode)

  • run cli.create.inventory (with forwarded inventory_args)

  • ensure CI vault password file

  • run cli.deploy.dedicated (with forwarded deploy_args)

  • always remove container at the end

cli.deploy.container.start_ci_container(image: str, build: bool, rebuild: bool, no_cache: bool, name: str | None = None) str

Start a CI container that uses the host Docker socket (no Docker-in-Docker).

Returns the container name.

cli.deploy.container.stop_container(name: str) None