Configurable docker-compose path

This commit is contained in:
jpk 2023-01-10 09:48:15 +01:00
parent 526f78f44d
commit 66c3422141
1 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,8 @@ from typing import List
from pathlib import Path
import subprocess
import click
def find_services(root: Path) -> List[str]:
return [_.split("/")[0] for _ in glob.glob("*/docker-compose.y*ml", root_dir=root)]
@ -17,5 +19,7 @@ def get_compose_file(service_path: Path) -> Path:
def docker_compose_command(commands: List[str], compose_file: Path):
cmd = ["docker-compose", "-f", compose_file] + list(commands)
ctx = click.get_current_context()
config = ctx.obj["CONFIG"]
cmd = [config.compose_executable, "-f", compose_file] + list(commands)
subprocess.run(cmd)