mirror of https://github.com/databricks/cli.git
Cleanup
This commit is contained in:
parent
50b76bb41e
commit
6b221c02e5
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue