You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
fix: Fix deploy to cloud run on Windows
Merge https://github.com/google/adk-python/pull/3536 - Closes: #1597 - Related: #3306 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/3536 from anrzeszutek:main ab9f6bfcd51b373934c0c03ef41c880ce224b31d PiperOrigin-RevId: 832441843
This commit is contained in:
committed by
Copybara-Service
parent
7c993b01d1
commit
29fea7ec1f
@@ -24,6 +24,9 @@ from typing import Optional
|
||||
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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user