Run initialize phase from validate command (#145)

This lets the user know if their workspace connection is setup
correctly.
This commit is contained in:
Pieter Noordhuis 2022-12-16 15:00:48 +01:00 committed by GitHub
parent 4026b2cda2
commit f70a5814f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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