prefect.cli.deploy

Module containing implementation for deploying flows.

Functions

init

init(name: Optional[str] = None, recipe: Optional[str] = None, fields: Optional[list[str]] = typer.Option(None, '-f', '--field', help='One or more fields to pass to the recipe (e.g., image_name) in the format of key=value.'))
Initialize a new deployment configuration recipe.

deploy

deploy(entrypoint: str = typer.Argument(None, help='The path to a flow entrypoint within a project, in the form of `./path/to/file.py:flow_func_name`'), names: List[str] = typer.Option(None, '--name', '-n', help="The name to give the deployment. Can be a pattern. Examples: 'my-deployment', 'my-flow/my-deployment', 'my-deployment-*', '*-flow-name/deployment*'"), description: str = typer.Option(None, '--description', '-d', help="The description to give the deployment. If not provided, the description will be populated from the flow's description."), version_type: str = typer.Option(None, '--version-type', help='The type of version to use for this deployment.'), version: str = typer.Option(None, '--version', help='A version to give the deployment.'), tags: List[str] = typer.Option(None, '-t', '--tag', help='One or more optional tags to apply to the deployment. Note: tags are used only for organizational purposes. For delegating work to workers, use the --work-queue flag.'), concurrency_limit: int = typer.Option(None, '-cl', '--concurrency-limit', help='The maximum number of concurrent runs for this deployment.'), concurrency_limit_collision_strategy: str = typer.Option(None, '--collision-strategy', help='Configure the behavior for runs once the concurrency limit is reached. Falls back to `ENQUEUE` if unset.'), work_pool_name: str = SettingsOption(PREFECT_DEFAULT_WORK_POOL_NAME, '-p', '--pool', help="The work pool that will handle this deployment's runs."), work_queue_name: str = typer.Option(None, '-q', '--work-queue', help="The work queue that will handle this deployment's runs. It will be created if it doesn't already exist. Defaults to `None`."), job_variables: List[str] = typer.Option(None, '-jv', '--job-variable', help='One or more job variable overrides for the work pool provided in the format of key=value string or a JSON object'), cron: List[str] = typer.Option(None, '--cron', help='A cron string that will be used to set a CronSchedule on the deployment.'), interval: List[int] = typer.Option(None, '--interval', help='An integer specifying an interval (in seconds) that will be used to set an IntervalSchedule on the deployment.'), interval_anchor: Optional[str] = typer.Option(None, '--anchor-date', help='The anchor date for all interval schedules'), rrule: List[str] = typer.Option(None, '--rrule', help='An RRule that will be used to set an RRuleSchedule on the deployment.'), timezone: str = typer.Option(None, '--timezone', help="Deployment schedule timezone string e.g. 'America/New_York'"), trigger: List[str] = typer.Option(None, '--trigger', help='Specifies a trigger for the deployment. The value can be a json string or path to `.yaml`/`.json` file. This flag can be used multiple times.'), param: List[str] = typer.Option(None, '--param', help='An optional parameter override, values are parsed as JSON strings e.g. --param question=ultimate --param answer=42'), params: str = typer.Option(None, '--params', help='An optional parameter override in a JSON string format e.g. --params=\'{"question": "ultimate", "answer": 42}\''), enforce_parameter_schema: bool = typer.Option(True, help='Whether to enforce the parameter schema on this deployment. If set to True, any parameters passed to this deployment must match the signature of the flow.'), deploy_all: bool = typer.Option(False, '--all', help='Deploy all flows in the project. If a flow name or entrypoint is also provided, this flag will be ignored.'), prefect_file: Path = typer.Option(Path('prefect.yaml'), '--prefect-file', help='Specify a custom path to a prefect.yaml file'), sla: List[str] = typer.Option(None, '--sla', help='Experimental: One or more SLA configurations for the deployment. May be removed or modified at any time. Currently only supported on Prefect Cloud.'))
Create a deployment to deploy a flow from this project. Should be run from a project root directory.