Skip to content

Commit 3cd5029

Browse files
committed
✨ Add support for new statuses
1 parent 79edb8a commit 3cd5029

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/fastapi_cloud_cli/commands/deploy.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,26 @@ def _create_app(team_id: str, app_name: str) -> AppResponse:
9696

9797
class DeploymentStatus(str, Enum):
9898
waiting_upload = "waiting_upload"
99+
ready_for_build = "ready_for_build"
99100
building = "building"
101+
extracting = "extracting"
102+
building_image = "building_image"
100103
deploying = "deploying"
101104
success = "success"
102105
failed = "failed"
103-
ready_for_build = "ready_for_build"
106+
107+
@classmethod
108+
def to_human_readable(cls, status: "DeploymentStatus") -> str:
109+
return {
110+
cls.waiting_upload: "Waiting for upload",
111+
cls.ready_for_build: "Ready for build",
112+
cls.building: "Building",
113+
cls.extracting: "Extracting",
114+
cls.building_image: "Building image",
115+
cls.deploying: "Deploying",
116+
cls.success: "Success",
117+
cls.failed: "Failed",
118+
}[status]
104119

105120

106121
class CreateDeploymentResponse(BaseModel):
@@ -322,7 +337,10 @@ def _wait_for_deployment(
322337

323338
raise typer.Exit(1)
324339
else:
325-
progress.log(next(messages))
340+
message = next(messages)
341+
progress.log(
342+
f"{message} ({DeploymentStatus.to_human_readable(deployment.status)})"
343+
)
326344

327345
time.sleep(4)
328346
time_elapsed += 4

0 commit comments

Comments
 (0)