Skip to content

Commit

Permalink
feat(example): add Backstage validation to example
Browse files Browse the repository at this point in the history
Newly generated repos will come with Backstage validation out of the
box.
  • Loading branch information
odsod committed Feb 15, 2024
1 parent fdba8f4 commit 5578700
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion example/.sage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5578700

Please sign in to comment.