Skip to content

Commit

Permalink
poc: app deploy command
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gbloom committed Mar 15, 2024
1 parent 6a48f26 commit 4198548
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
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(
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)

0 comments on commit 4198548

Please sign in to comment.