Skip to content

Commit 669c064

Browse files
Revert "Don't support databricks bundle run --deploy for now"
This reverts commit ddcd613.
1 parent ddcd613 commit 669c064

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmd/bundle/run.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
)
1515

1616
var runOptions run.Options
17+
var deployFlag bool
1718
var noWait bool
1819

1920
var runCmd = &cobra.Command{
@@ -25,6 +26,17 @@ var runCmd = &cobra.Command{
2526
RunE: func(cmd *cobra.Command, args []string) error {
2627
b := bundle.Get(cmd.Context())
2728

29+
if deployFlag {
30+
err := deploy(cmd, b)
31+
if err != nil {
32+
return err
33+
}
34+
} else if computeID != "" {
35+
// Running notebooks is not yet implemented, otherwise we could
36+
// use --compute with a notebook
37+
return fmt.Errorf("not supported: --compute specified without --deploy")
38+
}
39+
2840
err := bundle.Apply(cmd.Context(), b, bundle.Seq(
2941
phases.Initialize(),
3042
terraform.Interpolate(),
@@ -92,5 +104,8 @@ var runCmd = &cobra.Command{
92104
func init() {
93105
runOptions.Define(runCmd.Flags())
94106
rootCmd.AddCommand(runCmd)
107+
runCmd.Flags().BoolVar(&deployFlag, "deploy", false, "Call deploy before run.")
108+
runCmd.Flags().BoolVar(&forceDeploy, "force", false, "Force acquisition of deployment lock.")
95109
runCmd.Flags().BoolVar(&noWait, "no-wait", false, "Don't wait for the run to complete.")
110+
runCmd.Flags().StringVar(&computeID, "compute", "", "Override compute in the deployment with the given compute ID.")
96111
}

0 commit comments

Comments
 (0)