Skip to content

Commit

Permalink
[FIX] Correct always using docker compose, even if it not compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
josep-tecnativa committed Apr 10, 2024
1 parent e2bc946 commit 713bb90
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tasks_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import shutil
import stat
import subprocess
import tempfile
import time
from datetime import datetime
Expand Down Expand Up @@ -46,8 +47,15 @@
"build"
]["args"]["ODOO_VERSION"]
)
DOCKER_COMPOSE_CMD = f"{shutil.which('docker')} compose" or shutil.which(
"docker-compose"

docker_compose_v2 = (
subprocess.run([which("docker"), "compose"], capture_output=True).returncode == 0
)

DOCKER_COMPOSE_CMD = (
f"{shutil.which('docker')} compose"
if docker_compose_v2
else shutil.which("docker-compose")
)

_logger = getLogger(__name__)
Expand Down

0 comments on commit 713bb90

Please sign in to comment.