Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions samcli/commands/deploy/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
tags_override_option,
template_click_option,
)
from samcli.commands.deploy.utils import print_deploy_args, sanitize_parameter_overrides
from samcli.commands.deploy.utils import sanitize_parameter_overrides
from samcli.lib.telemetry.metrics import track_command
from samcli.lib.utils import osutils

Expand Down Expand Up @@ -222,15 +222,6 @@ def do_cli(
)
guided_context.run()

print_deploy_args(
stack_name=guided_context.guided_stack_name if guided else stack_name,
s3_bucket=guided_context.guided_s3_bucket if guided else s3_bucket,
region=guided_context.guided_region if guided else region,
capabilities=guided_context.guided_capabilities if guided else capabilities,
parameter_overrides=guided_context.guided_parameter_overrides if guided else parameter_overrides,
confirm_changeset=guided_context.confirm_changeset if guided else confirm_changeset,
)

with osutils.tempfile_platform_independent() as output_template_file:

with PackageContext(
Expand Down
11 changes: 9 additions & 2 deletions samcli/commands/deploy/deploy_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from samcli.commands._utils.template import get_template_data
from samcli.commands.deploy import exceptions as deploy_exceptions
from samcli.commands.deploy.auth_utils import auth_per_resource
from samcli.commands.deploy.utils import sanitize_parameter_overrides
from samcli.commands.deploy.utils import sanitize_parameter_overrides, print_deploy_args
from samcli.lib.deploy.deployer import Deployer
from samcli.lib.package.s3_uploader import S3Uploader
from samcli.lib.utils.botoconfig import get_boto_config_with_user_agent
Expand Down Expand Up @@ -118,7 +118,14 @@ def run(self):
self.deployer = Deployer(cloudformation_client)

region = s3_client._client_config.region_name if s3_client else self.region # pylint: disable=W0212

print_deploy_args(
self.stack_name,
self.s3_bucket,
region,
self.capabilities,
self.parameter_overrides,
self.confirm_changeset,
)
return self.deploy(
self.stack_name,
template_str,
Expand Down
11 changes: 10 additions & 1 deletion samcli/commands/deploy/guided_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from samcli.commands.deploy.exceptions import GuidedDeployFailedError
from samcli.commands.deploy.guided_config import GuidedConfig
from samcli.commands.deploy.auth_utils import auth_per_resource
from samcli.commands.deploy.utils import sanitize_parameter_overrides
from samcli.commands.deploy.utils import sanitize_parameter_overrides, print_deploy_args
from samcli.lib.bootstrap.bootstrap import manage_stack
from samcli.lib.utils.colors import Colored

Expand Down Expand Up @@ -163,6 +163,15 @@ def run(self):
guided_config = GuidedConfig(template_file=self.template_file, section=self.config_section)
guided_config.read_config_showcase()

print_deploy_args(
stack_name=self.guided_stack_name,
s3_bucket=self.guided_s3_bucket,
region=self.guided_region,
capabilities=self._capabilities,
parameter_overrides=self._parameter_overrides,
confirm_changeset=self.confirm_changeset,
)

self.guided_prompts(_parameter_override_keys)

if self.save_to_config:
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/commands/deploy/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_all_args(self, mock_deploy_context, mock_deploy_click, mock_package_con
@patch("samcli.commands.package.package_context.PackageContext")
@patch("samcli.commands.deploy.command.click")
@patch("samcli.commands.deploy.deploy_context.DeployContext")
@patch("samcli.commands.deploy.command.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.manage_stack")
@patch("samcli.commands.deploy.guided_context.auth_per_resource")
@patch("samcli.commands.deploy.guided_context.get_template_parameters")
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_all_args_guided_no_to_authorization_confirmation_prompt(
@patch("samcli.commands.package.package_context.PackageContext")
@patch("samcli.commands.deploy.command.click")
@patch("samcli.commands.deploy.deploy_context.DeployContext")
@patch("samcli.commands.deploy.command.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.manage_stack")
@patch("samcli.commands.deploy.guided_context.auth_per_resource")
@patch("samcli.commands.deploy.guided_context.get_template_parameters")
Expand Down Expand Up @@ -261,7 +261,7 @@ def test_all_args_guided(
@patch("samcli.commands.package.package_context.PackageContext")
@patch("samcli.commands.deploy.command.click")
@patch("samcli.commands.deploy.deploy_context.DeployContext")
@patch("samcli.commands.deploy.command.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.manage_stack")
@patch("samcli.commands.deploy.guided_context.auth_per_resource")
@patch("samcli.commands.deploy.guided_context.get_template_data")
Expand Down Expand Up @@ -380,7 +380,7 @@ def test_all_args_guided_no_save_echo_param_to_config(
@patch("samcli.commands.package.package_context.PackageContext")
@patch("samcli.commands.deploy.command.click")
@patch("samcli.commands.deploy.deploy_context.DeployContext")
@patch("samcli.commands.deploy.command.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.auth_per_resource")
@patch("samcli.commands.deploy.guided_context.get_template_data")
@patch("samcli.commands.deploy.guided_context.manage_stack")
Expand Down Expand Up @@ -484,7 +484,7 @@ def test_all_args_guided_no_params_save_config(
@patch("samcli.commands.package.package_context.PackageContext")
@patch("samcli.commands.deploy.command.click")
@patch("samcli.commands.deploy.deploy_context.DeployContext")
@patch("samcli.commands.deploy.command.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.print_deploy_args")
@patch("samcli.commands.deploy.guided_context.manage_stack")
@patch("samcli.commands.deploy.guided_context.auth_per_resource")
@patch("samcli.commands.deploy.guided_context.get_template_data")
Expand Down