Run docker command with streaming output using RunningProcess.
(cmd: list[str])
| 115 | |
| 116 | |
| 117 | def run_docker_command_streaming(cmd: list[str]) -> int: |
| 118 | """Run docker command with streaming output using RunningProcess.""" |
| 119 | print(f"Executing: {' '.join(cmd)}") |
| 120 | proc = RunningProcess(cmd, env=get_docker_env(), auto_run=True) |
| 121 | |
| 122 | # Stream all output to stdout |
| 123 | with proc.line_iter(timeout=None) as it: |
| 124 | for line in it: |
| 125 | print(line) |
| 126 | |
| 127 | returncode = cast(int, proc.wait()) |
| 128 | if returncode != 0: |
| 129 | raise subprocess.CalledProcessError(returncode, cmd) |
| 130 | return returncode |
| 131 | |
| 132 | |
| 133 | def run_docker_command_no_fail(cmd: list[str]) -> int: |
no test coverage detected