2022-12-12 11:49:25 +00:00
|
|
|
package bundle
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/databricks/bricks/bundle"
|
|
|
|
"github.com/databricks/bricks/bundle/phases"
|
2023-01-27 16:05:57 +00:00
|
|
|
"github.com/databricks/bricks/cmd/root"
|
2022-12-12 11:49:25 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var deployCmd = &cobra.Command{
|
|
|
|
Use: "deploy",
|
|
|
|
Short: "Deploy bundle",
|
|
|
|
|
2023-01-27 16:05:57 +00:00
|
|
|
PreRunE: root.MustConfigureBundle,
|
2022-12-12 11:49:25 +00:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
b := bundle.Get(cmd.Context())
|
|
|
|
return bundle.Apply(cmd.Context(), b, []bundle.Mutator{
|
|
|
|
phases.Initialize(),
|
|
|
|
phases.Build(),
|
|
|
|
phases.Deploy(),
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
AddCommand(deployCmd)
|
|
|
|
}
|