From 56ca19a3177fa3ba3c5c92f6db5090c06d91cffb Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Sun, 5 May 2024 10:46:03 +1000 Subject: [PATCH] [Resolve #1464] Order of operations for launch Akin to `sceptre delete`, display the order of operations when issuing `sceptre launch` for a visual representation of dependencies. --- sceptre/cli/launch.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sceptre/cli/launch.py b/sceptre/cli/launch.py index 9b8514115..0581c7c65 100644 --- a/sceptre/cli/launch.py +++ b/sceptre/cli/launch.py @@ -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)