From f70a5814f6e62e68df6c9223427df0c2744a9c19 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 16 Dec 2022 15:00:48 +0100 Subject: [PATCH] Run initialize phase from validate command (#145) This lets the user know if their workspace connection is setup correctly. --- cmd/bundle/validate.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/bundle/validate.go b/cmd/bundle/validate.go index 3dfed687..d92913c7 100644 --- a/cmd/bundle/validate.go +++ b/cmd/bundle/validate.go @@ -4,6 +4,7 @@ import ( "encoding/json" "github.com/databricks/bricks/bundle" + "github.com/databricks/bricks/bundle/phases" "github.com/spf13/cobra" ) @@ -14,6 +15,13 @@ var validateCmd = &cobra.Command{ PreRunE: ConfigureBundle, RunE: func(cmd *cobra.Command, args []string) error { b := bundle.Get(cmd.Context()) + err := bundle.Apply(cmd.Context(), b, []bundle.Mutator{ + phases.Initialize(), + }) + if err != nil { + return err + } + buf, err := json.MarshalIndent(b.Config, "", " ") if err != nil { return err