Run a single Docker step with streaming output. Returns the exit code.
(step_name: str, bash_script: str, timeout: int = 1800)
| 430 | ) |
| 431 | |
| 432 | def _run_docker_step(step_name: str, bash_script: str, timeout: int = 1800) -> int: |
| 433 | """Run a single Docker step with streaming output. |
| 434 | |
| 435 | Returns the exit code. |
| 436 | """ |
| 437 | from running_process import RunningProcess |
| 438 | |
| 439 | ts_print(f"=== Docker: {step_name} ===") |
| 440 | # Remove existing container before each step (--rm removes it after, but |
| 441 | # if a previous step crashed the name may linger) |
| 442 | existing = docker_container_exists(container_name) |
| 443 | if existing: |
| 444 | docker_force_remove_container(existing) |
| 445 | |
| 446 | cmd = docker_base_args + [bash_script] |
| 447 | proc = RunningProcess(cmd, auto_run=True) |
| 448 | return cast(int, proc.wait(echo=True, timeout=timeout)) |
| 449 | |
| 450 | try: |
| 451 | rc = _run_docker_step( |
no test coverage detected