Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding app deploy command #904

23 changes: 23 additions & 0 deletions src/snowflake/cli/plugins/nativeapp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,26 @@ def app_teardown(
)
processor.process(force)
return MessageResult(f"Teardown is now complete.")


@app.command("deploy", requires_connection=True)
@with_project_definition("native_app")
def app_deploy(
**options,
) -> CommandResult:
"""
Syncs the local changes to the stage without creating or updating the application.
"""

processor = NativeAppRunProcessor(
project_definition=cli_context.project_definition,
project_root=cli_context.project_root,
)

processor.build_bundle()
processor.process(
sfc-gh-gbloom marked this conversation as resolved.
Show resolved Hide resolved
policy=DenyAlwaysPolicy(),
skip_app_update=True,
)

return MessageResult(f"Deployed successfully.")
6 changes: 4 additions & 2 deletions src/snowflake/cli/plugins/nativeapp/run_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ def process(
patch: Optional[str] = None,
from_release_directive: bool = False,
is_interactive: bool = False,
skip_app_update: bool = True,
*args,
**kwargs,
):
Expand Down Expand Up @@ -395,5 +396,6 @@ def process(
# 3. Upload files from deploy root local folder to the above stage
diff = self.sync_deploy_root_with_stage(self.package_role)

# 4. Create an application if none exists, else upgrade the application
self._create_dev_app(diff)
if not skip_app_update:
# 4. Create an application if none exists, else upgrade the application
self._create_dev_app(diff)
Loading