Expose the Analize method of yip (#548)

This only shows for a given stage what steps would be run and in which
order

Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
Itxaka
2024-09-20 10:36:09 +02:00
committed by GitHub
parent 970eb1aa72
commit bd4dce015f
5 changed files with 49 additions and 9 deletions

View File

@@ -667,6 +667,11 @@ The validate command expects a configuration file as its only argument. Local fi
Name: "cloud-init-paths",
Usage: "Extra paths to add to the run stage",
},
&cli.BoolFlag{
Name: "analyze",
Usage: "Only print the modules that would run in the order they would run",
Aliases: []string{"a"},
},
},
Before: func(c *cli.Context) error {
if c.Args().Len() != 1 {
@@ -692,6 +697,9 @@ The validate command expects a configuration file as its only argument. Local fi
if err != nil {
config.Logger.Errorf("Error reading config: %s\n", err)
}
if c.Bool("analyze") {
return utils.RunStageAnalyze(config, stage)
}
return utils.RunStage(config, stage)
},
},