Skip to content

Commit ea6a940

Browse files
committed
ci: fixes
1 parent 353336b commit ea6a940

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

appwrite_lab/_orchestrator.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,23 @@ def compose(self):
460460

461461

462462
def detect_backend():
463-
if shutil.which("docker") and (
464-
shutil.which("docker-compose") or shutil.which("docker compose")
465-
):
466-
# If docker is available, we can use docker compose (subcommand)
467-
# or docker-compose (standalone binary)
468-
return "docker"
469-
elif shutil.which("podman") and shutil.which("podman-compose"):
463+
if shutil.which("docker"):
464+
try:
465+
subprocess.run(
466+
["docker", "compose", "version"],
467+
check=True,
468+
stdout=subprocess.DEVNULL,
469+
stderr=subprocess.DEVNULL,
470+
)
471+
return "docker"
472+
except Exception:
473+
pass
474+
# Check for legacy 'docker-compose' binary
475+
if shutil.which("docker-compose"):
476+
return "docker"
477+
if shutil.which("podman") and shutil.which("podman-compose"):
470478
return "podman"
471-
else:
472-
raise RuntimeError("Neither Docker nor Podman found.")
479+
raise RuntimeError("Neither Docker nor Podman found.")
473480

474481

475482
def run_cmd(cmd: list[str], envs: dict[str, str] | None = None):

0 commit comments

Comments
 (0)