From 3cd50291531122b5c36da46a6ddda9382b804026 Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Fri, 10 Jan 2025 17:49:47 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20new=20statuse?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fastapi_cloud_cli/commands/deploy.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/fastapi_cloud_cli/commands/deploy.py b/src/fastapi_cloud_cli/commands/deploy.py index ae3eb5d..70fca43 100644 --- a/src/fastapi_cloud_cli/commands/deploy.py +++ b/src/fastapi_cloud_cli/commands/deploy.py @@ -96,11 +96,26 @@ def _create_app(team_id: str, app_name: str) -> AppResponse: class DeploymentStatus(str, Enum): waiting_upload = "waiting_upload" + ready_for_build = "ready_for_build" building = "building" + extracting = "extracting" + building_image = "building_image" deploying = "deploying" success = "success" failed = "failed" - ready_for_build = "ready_for_build" + + @classmethod + def to_human_readable(cls, status: "DeploymentStatus") -> str: + return { + cls.waiting_upload: "Waiting for upload", + cls.ready_for_build: "Ready for build", + cls.building: "Building", + cls.extracting: "Extracting", + cls.building_image: "Building image", + cls.deploying: "Deploying", + cls.success: "Success", + cls.failed: "Failed", + }[status] class CreateDeploymentResponse(BaseModel): @@ -322,7 +337,10 @@ def _wait_for_deployment( raise typer.Exit(1) else: - progress.log(next(messages)) + message = next(messages) + progress.log( + f"{message} ({DeploymentStatus.to_human_readable(deployment.status)})" + ) time.sleep(4) time_elapsed += 4