Skip to content

Commit

Permalink
[Resolves Sceptre#1464] Display launch order
Browse files Browse the repository at this point in the history
Akin to `sceptre delete`, display the order of operations that would
occur when issuing `sceptre launch`.
  • Loading branch information
p7-mark committed May 5, 2024
1 parent 826134a commit 4719c5e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions sceptre/cli/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,27 @@ def print_operations(self, prune: bool):

dependencies = ""
for stack in deploy_plan:
if stack.ignore or stack.obsolete:
dependencies += "{}{} **skipped{}\n".format(Fore.LIGHTWHITE_EX, stack.name, Style.RESET_ALL)
if stack.ignore or (stack.obsolete and not prune):
dependencies += "{}Skip:\t{}{}\n".format(
Fore.LIGHTWHITE_EX,
stack.name,
Style.RESET_ALL,
)
elif stack.obsolete and prune:
dependencies += "{}Delete:\t{}{}\n".format(
Fore.RED,
stack.name,
Style.RESET_ALL,
)
else:
dependencies += "{}{}{}\n".format(Fore.YELLOW, stack.name, Style.RESET_ALL)
dependencies += "{}Deploy:\t{}{}\n".format(
Fore.YELLOW,
stack.name,
Style.RESET_ALL,
)

print(f"The following stacks, in the following order, will be deployed:\n{dependencies}")
print(f"The following operations will occur, in the following order:")
print(dependencies)

def launch(self, prune: bool) -> int:
deploy_plan = self._create_deploy_plan()
Expand Down

0 comments on commit 4719c5e

Please sign in to comment.