This commit is contained in:
Lennart Kats 2023-07-07 11:12:14 +02:00
parent 50b76bb41e
commit 6b221c02e5
2 changed files with 13 additions and 16 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/databricks/cli/bundle"
"github.com/databricks/cli/bundle/config"
"github.com/databricks/databricks-sdk-go/service/jobs"
"github.com/databricks/databricks-sdk-go/service/ml"
)
@ -37,13 +38,13 @@ func processDevelopmentMode(b *bundle.Bundle) error {
r.Jobs[i].MaxConcurrentRuns = developmentConcurrentRuns
}
if r.Jobs[i].Schedule != nil {
r.Jobs[i].Schedule.PauseStatus = "PAUSED"
r.Jobs[i].Schedule.PauseStatus = jobs.PauseStatusPaused
}
if r.Jobs[i].Continuous != nil {
r.Jobs[i].Continuous.PauseStatus = "PAUSED"
r.Jobs[i].Continuous.PauseStatus = jobs.PauseStatusPaused
}
if r.Jobs[i].Trigger != nil {
r.Jobs[i].Trigger.PauseStatus = "PAUSED"
r.Jobs[i].Trigger.PauseStatus = jobs.PauseStatusPaused
}
}

View File

@ -14,22 +14,18 @@ var deployCmd = &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {
b := bundle.Get(cmd.Context())
return deploy(cmd, b)
// If `--force` is specified, force acquisition of the deployment lock.
b.Config.Bundle.Lock.Force = forceDeploy
b.Config.Bundle.ComputeID = computeID
return bundle.Apply(cmd.Context(), b, bundle.Seq(
phases.Initialize(),
phases.Build(),
phases.Deploy(),
))
},
}
func deploy(cmd *cobra.Command, b *bundle.Bundle) error {
// If `--force` is specified, force acquisition of the deployment lock.
b.Config.Bundle.Lock.Force = forceDeploy
b.Config.Bundle.ComputeID = computeID
return bundle.Apply(cmd.Context(), b, bundle.Seq(
phases.Initialize(),
phases.Build(),
phases.Deploy(),
))
}
var forceDeploy bool
var computeID string