Skip to content

Commit

Permalink
[Resolve 1464] Order of operations for launch
Browse files Browse the repository at this point in the history
Akin to `sceptre delete`, display the order of operations when issuing
`sceptre launch` for a visual representation of dependencies.
  • Loading branch information
p7-mark committed May 5, 2024
1 parent a6952c7 commit c0cb0a6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions sceptre/cli/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@ def print_operations(self, prune: bool):
pruner = self._make_pruner(self._context, self._make_plan)
pruner.print_operations()

dependencies = ""
for stack in deploy_plan:
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 += "{}Deploy:\t{}{}\n".format(
Fore.YELLOW,
stack.name,
Style.RESET_ALL,
)

print("The following operations will occur, in the following order:")
print(dependencies)

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

0 comments on commit c0cb0a6

Please sign in to comment.