MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / deploy

Method deploy

lib/cli/src/crewai_cli/deploy/main.py:289–332  ·  view source on GitHub ↗

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. source (DeploySource): Where the deployment was initiated from.

(
        self,
        uuid: str | None = None,
        skip_validate: bool = False,
        source: DeploySource = "cli",
    )

Source from the content-addressed store, hash-verified

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

Calls 15

_update_crew_from_zipMethod · 0.95
fetch_and_json_env_fileFunction · 0.90
_display_git_remote_helpFunction · 0.85
origin_urlMethod · 0.80
deploy_by_uuidMethod · 0.80
deploy_by_nameMethod · 0.80
_validate_responseMethod · 0.80