Deploy a crew using either UUID or project name. Args: uuid (Optional[str]): The UUID of the crew to deploy. skip_validate (bool): Skip pre-deploy validation checks.
(self, uuid: str | None = None, skip_validate: bool = False)
| 286 | return _deployment_identifier(status_response) |
| 287 | |
| 288 | def deploy(self, uuid: str | None = None, skip_validate: bool = False) -> None: |
| 289 | """ |
| 290 | Deploy a crew using either UUID or project name. |
| 291 | |
| 292 | Args: |
| 293 | uuid (Optional[str]): The UUID of the crew to deploy. |
| 294 | skip_validate (bool): Skip pre-deploy validation checks. |
| 295 | """ |
| 296 | if not _prepare_project_for_deploy(skip_validate): |
| 297 | return |
| 298 | self._telemetry.start_deployment_span(uuid) |
| 299 | console.print("Starting deployment...", style="bold blue") |
| 300 | repository = self._prepare_git_repository() |
| 301 | remote_repo_url = repository.origin_url() if repository else None |
| 302 | |
| 303 | if remote_repo_url and uuid: |
| 304 | response = self.plus_api_client.deploy_by_uuid(uuid) |
| 305 | elif remote_repo_url and self.project_name: |
| 306 | response = self.plus_api_client.deploy_by_name(self.project_name) |
| 307 | elif uuid: |
| 308 | _display_git_remote_help() |
| 309 | env_vars = fetch_and_json_env_file() |
| 310 | response = self._update_crew_from_zip(uuid, repository, env_vars) |
| 311 | elif self.project_name: |
| 312 | _display_git_remote_help() |
| 313 | deployment_uuid = self._deployment_uuid_by_name() |
| 314 | env_vars = fetch_and_json_env_file() |
| 315 | response = self._update_crew_from_zip( |
| 316 | deployment_uuid, |
| 317 | repository, |
| 318 | env_vars, |
| 319 | ) |
| 320 | else: |
| 321 | self._standard_no_param_error_message() |
| 322 | return |
| 323 | |
| 324 | self._validate_response(response) |
| 325 | self._display_deployment_info(response.json()) |
| 326 | |
| 327 | def _deployment_uuid_by_name(self) -> str: |
| 328 | """Resolve the current project's deployment UUID by project name.""" |