MCPcopy
hub / github.com/reflex-dev/reflex / deploy

Function deploy

packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py:77–466  ·  view source on GitHub ↗

Deploy the app to the Reflex hosting service. Args: app_name: The name of the app. export_fn: The function from the Reflex main framework to export the app. description: The app's description. regions: The regions to deploy to. project: The project to dep

(
    export_fn: Callable[[str, str, str, bool, bool, bool, bool], None]
    | Callable[[str, str, str, bool, bool, bool], None],
    app_name: str | None = None,
    description: str | None = None,
    regions: list[str] | None = None,
    project: str | None = None,
    envs: list[str] | None = None,
    vmtype: str | None = None,
    hostname: str | None = None,
    interactive: bool = True,
    envfile: str | None = None,
    loglevel: constants.LogLevel = constants.LogLevel.INFO,
    token: str | None = None,
    config_path: str | None = None,
    env: str | None = None,
    project_name: str | None = None,
    app_id: str | None = None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

75
76
77def deploy(
78 export_fn: Callable[[str, str, str, bool, bool, bool, bool], None]
79 | Callable[[str, str, str, bool, bool, bool], None],
80 app_name: str | None = None,
81 description: str | None = None,
82 regions: list[str] | None = None,
83 project: str | None = None,
84 envs: list[str] | None = None,
85 vmtype: str | None = None,
86 hostname: str | None = None,
87 interactive: bool = True,
88 envfile: str | None = None,
89 loglevel: constants.LogLevel = constants.LogLevel.INFO,
90 token: str | None = None,
91 config_path: str | None = None,
92 env: str | None = None,
93 project_name: str | None = None,
94 app_id: str | None = None,
95 **kwargs,
96):
97 """Deploy the app to the Reflex hosting service.
98
99 Args:
100 app_name: The name of the app.
101 export_fn: The function from the Reflex main framework to export the app.
102 description: The app's description.
103 regions: The regions to deploy to.
104 project: The project to deploy to.
105 envs: The environment variables to set.
106 vmtype: The VM type to allocate.
107 hostname: The hostname to use for the frontend.
108 interactive: Whether to use interactive mode.
109 envfile: The path to an env file to use. Will override any envs set manually.
110 loglevel: The log level to use.
111 token: The authentication token.
112 config_path: The path to the config file.
113 env: The environment to use for deployment.
114 project_name: The name of the project.
115 app_id: The ID of the app.
116 **kwargs: Additional keyword arguments.
117
118 Raises:
119 Exit: If the command fails.
120
121 """
122 import httpx
123
124 from reflex_cli.utils import hosting
125
126 authenticated_client = hosting.get_authenticated_client(
127 token=token, interactive=interactive
128 )
129
130 # Set the log level.
131 console.set_log_level(loglevel)
132 project_id = project
133 config = {}
134 config_from_file = hosting.read_config(config_path, env=env)

Callers

nothing calls this directly

Calls 7

extract_domainFunction · 0.90
PathClass · 0.85
getenvMethod · 0.80
parseMethod · 0.80
existsMethod · 0.80
getMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected