From 5578700700c2b6e69da329e5d72cd1d220f00f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20S=C3=B6derlund?= Date: Thu, 6 Jul 2023 17:18:07 +0200 Subject: [PATCH] feat(example): add Backstage validation to example Newly generated repos will come with Backstage validation out of the box. --- example/.sage/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/example/.sage/main.go b/example/.sage/main.go index 3ddd060c..6ee23ac7 100644 --- a/example/.sage/main.go +++ b/example/.sage/main.go @@ -4,6 +4,7 @@ import ( "context" "go.einride.tech/sage/sg" + "go.einride.tech/sage/tools/sgbackstage" "go.einride.tech/sage/tools/sgconvco" "go.einride.tech/sage/tools/sggit" "go.einride.tech/sage/tools/sggo" @@ -24,7 +25,8 @@ func main() { } func Default(ctx context.Context) error { - sg.Deps(ctx, ConvcoCheck, FormatMarkdown, FormatYaml) + sg.Deps(ctx, ConvcoCheck, BackstageValidate) + sg.Deps(ctx, FormatMarkdown, FormatYaml) sg.Deps(ctx, GoLint, GoReview) sg.Deps(ctx, GoTest) sg.Deps(ctx, GoModTidy) @@ -67,6 +69,11 @@ func FormatYaml(ctx context.Context) error { return sgyamlfmt.Run(ctx) } +func BackstageValidate(ctx context.Context) error { + sg.Logger(ctx).Println("validating Backstage files...") + return sgbackstage.Validate(ctx) +} + func ConvcoCheck(ctx context.Context) error { sg.Logger(ctx).Println("checking git commits...") return sgconvco.Command(ctx, "check", "origin/master..HEAD").Run()