Compare commits

...

2 Commits

Author SHA1 Message Date
simon
2d6db88f4c add apps 2024-10-29 12:54:53 -07:00
simon
c4e14d3670 hosting v1 2024-10-25 18:41:04 -07:00

View File

@ -481,12 +481,6 @@ def makemigrations(
@cli.command()
def deploy(
key: Optional[str] = typer.Option(
None,
"-k",
"--deployment-key",
help="The name of the deployment. Domain name safe characters only.",
),
app_name: str = typer.Option(
config.app_name,
"--app-name",
@ -497,32 +491,21 @@ def deploy(
list(),
"-r",
"--region",
help="The regions to deploy to.",
help="The regions to deploy to. For multiple envs, repeat this option, e.g. --region sjc --region iad",
),
envs: List[str] = typer.Option(
list(),
"--env",
help="The environment variables to set: <key>=<value>. For multiple envs, repeat this option, e.g. --env k1=v2 --env k2=v2.",
),
cpus: Optional[int] = typer.Option(
None, help="The number of CPUs to allocate.", hidden=True
),
memory_mb: Optional[int] = typer.Option(
None, help="The amount of memory to allocate.", hidden=True
),
auto_start: Optional[bool] = typer.Option(
vmtype: Optional[str] = typer.Option(
None,
help="Whether to auto start the instance.",
hidden=True,
"--vmtype",
help="Vm type id. Run reflex apps vmtypes list to get options.",
),
auto_stop: Optional[bool] = typer.Option(
hostname: Optional[str] = typer.Option(
None,
help="Whether to auto stop the instance.",
hidden=True,
),
frontend_hostname: Optional[str] = typer.Option(
None,
"--frontend-hostname",
"--hostname",
help="The hostname of the frontend.",
hidden=True,
),
@ -530,24 +513,21 @@ def deploy(
True,
help="Whether to list configuration options and ask for confirmation.",
),
with_metrics: Optional[str] = typer.Option(
envfile: Optional[str] = typer.Option(
None,
help="Setting for metrics scraping for the deployment. Setup required in user code.",
hidden=True,
),
with_tracing: Optional[str] = typer.Option(
None,
help="Setting to export tracing for the deployment. Setup required in user code.",
hidden=True,
),
upload_db_file: bool = typer.Option(
False,
help="Whether to include local sqlite db files when uploading to hosting service.",
"--envfile",
help="The path to an env file to use. Will override any envs set manually.",
hidden=True,
),
loglevel: constants.LogLevel = typer.Option(
config.loglevel, help="The log level to use."
),
token: Optional[str] = typer.Option(
None,
"--token",
help="token to use for auth",
hidden=True,
),
):
"""Deploy the app to the Reflex hosting service."""
from reflex_cli import cli as hosting_cli
@ -569,12 +549,7 @@ def deploy(
hosting_cli.deploy(
app_name=app_name,
export_fn=lambda zip_dest_dir,
api_url,
deploy_url,
frontend,
backend,
zipping: export_utils.export(
export_fn=lambda zip_dest_dir, api_url, deploy_url, frontend, backend, zipping: export_utils.export(
zip_dest_dir=zip_dest_dir,
api_url=api_url,
deploy_url=deploy_url,
@ -582,20 +557,15 @@ def deploy(
backend=backend,
zipping=zipping,
loglevel=loglevel.subprocess_level(),
upload_db_file=upload_db_file,
),
key=key,
regions=regions,
envs=envs,
cpus=cpus,
memory_mb=memory_mb,
auto_start=auto_start,
auto_stop=auto_stop,
frontend_hostname=frontend_hostname,
vmtype=vmtype,
envfile=envfile,
hostname=hostname,
interactive=interactive,
with_metrics=with_metrics,
with_tracing=with_tracing,
loglevel=loglevel.subprocess_level(),
token=token,
)
@ -603,7 +573,7 @@ cli.add_typer(db_cli, name="db", help="Subcommands for managing the database sch
cli.add_typer(script_cli, name="script", help="Subcommands running helper scripts.")
cli.add_typer(
deployments_cli,
name="deployments",
name="apps",
help="Subcommands for managing the Deployments.",
)
cli.add_typer(