17 lines
439 B
Python
17 lines
439 B
Python
import subprocess
|
|
|
|
import click
|
|
|
|
|
|
def run(cmd, check=True, capture=True):
|
|
click.echo(f"+ {' '.join(cmd)}")
|
|
return subprocess.run(cmd, check=check, text=True, capture_output=capture)
|
|
|
|
|
|
def compose_exec(container, *args, check=True):
|
|
return run(["docker", "compose", "run", "--rm", container, *args], check=check)
|
|
|
|
|
|
def compose_cp(src, container, dst):
|
|
return run(["docker", "compose", "cp", str(src), f"{container}:{dst}"])
|