From 6b221c02e5a520a385b49bec1b853e4b6cbbe90a Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Fri, 7 Jul 2023 11:12:14 +0200 Subject: [PATCH] Cleanup --- .../mutator/process_environment_mode.go | 7 +++--- cmd/bundle/deploy.go | 22 ++++++++----------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/bundle/config/mutator/process_environment_mode.go b/bundle/config/mutator/process_environment_mode.go index 295afa8ab..2269007dc 100644 --- a/bundle/config/mutator/process_environment_mode.go +++ b/bundle/config/mutator/process_environment_mode.go @@ -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 } } diff --git a/cmd/bundle/deploy.go b/cmd/bundle/deploy.go index e87570199..e8c0d3958 100644 --- a/cmd/bundle/deploy.go +++ b/cmd/bundle/deploy.go @@ -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