diff --git a/src/google/adk/cli/cli_deploy.py b/src/google/adk/cli/cli_deploy.py index 1467e1e40e..1bf1d76c7a 100644 --- a/src/google/adk/cli/cli_deploy.py +++ b/src/google/adk/cli/cli_deploy.py @@ -24,6 +24,9 @@ import click from packaging.version import parse +_IS_WINDOWS = os.name == 'nt' +_GCLOUD_CMD = 'gcloud.cmd' if _IS_WINDOWS else 'gcloud' + _DOCKERFILE_TEMPLATE: Final[str] = """ FROM python:3.11-slim WORKDIR /app @@ -378,7 +381,7 @@ def _resolve_project(project_in_option: Optional[str]) -> str: return project_in_option result = subprocess.run( - ['gcloud', 'config', 'get-value', 'project'], + [_GCLOUD_CMD, 'config', 'get-value', 'project'], check=True, capture_output=True, text=True, @@ -585,7 +588,7 @@ def to_cloud_run( # Build the command with extra gcloud args gcloud_cmd = [ - 'gcloud', + _GCLOUD_CMD, 'run', 'deploy', service_name, diff --git a/tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py b/tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py index cc5c30c23d..17e91e988f 100644 --- a/tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py +++ b/tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py @@ -173,7 +173,7 @@ def test_to_cloud_run_happy_path( gcloud_args = run_recorder.get_last_call_args()[0] expected_gcloud_command = [ - "gcloud", + cli_deploy._GCLOUD_CMD, "run", "deploy", "svc",