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

Updating message when bootstrap stages are missing. #3058

Merged
merged 2 commits into from
Jul 15, 2021
Merged
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
23 changes: 12 additions & 11 deletions samcli/commands/pipeline/init/interactive_init_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ def _prompt_run_bootstrap_within_pipeline_init(self, stage_names: List[str], req
Prompt bootstrap if `--bootstrap` flag is provided. Return True if bootstrap process is executed.
"""
if not stage_names:
click.echo(Colored().yellow("No bootstrapped resources were detected."))
click.echo("[!] None detected in this account.")
else:
click.echo(
Colored().yellow(
f"Only {len(stage_names)} bootstrapped stage(s) were detected, "
f"Only {len(stage_names)} stage(s) were detected, "
f"fewer than what the template requires: {required_env_number}."
)
)
Expand Down Expand Up @@ -173,16 +173,17 @@ def _prompt_run_bootstrap_within_pipeline_init(self, stage_names: List[str], req
return True
else:
click.echo(
Colored().yellow(
dedent(
"""\
If you want to setup stages before proceed, please quit the process using Ctrl+C.
Then you can either run 'sam pipeline bootstrap' to setup a stage
or re-run this command with option '--bootstrap' to enable stage setup.
"""
)
dedent(
"""\
To set up stage(s), please quit the process using Ctrl+C and use one of the following commands:
sam pipeline init --bootstrap To be guided through the stage and config file creation process.
sam pipeline bootstrap To specify details for an individual stage.
"""
)
)
click.prompt(
"To reference stage resources bootstrapped in a different account, press enter to proceed", default=""
)
return False

def _generate_from_pipeline_template(self, pipeline_template_dir: Path) -> List[str]:
Expand All @@ -195,7 +196,7 @@ def _generate_from_pipeline_template(self, pipeline_template_dir: Path) -> List[
click.echo(f"You are using the {required_env_number}-stage pipeline template.")
_draw_stage_diagram(required_env_number)
while True:
click.echo("Checking for bootstrapped resources...\n")
click.echo("Checking for existing stages...\n")
stage_names, bootstrap_context = _load_pipeline_bootstrap_resources()
if len(stage_names) < required_env_number and self._prompt_run_bootstrap_within_pipeline_init(
stage_names, required_env_number
Expand Down