2022-12-12 11:49:25 +00:00
|
|
|
package phases
|
|
|
|
|
|
|
|
import (
|
2023-05-16 16:35:39 +00:00
|
|
|
"github.com/databricks/cli/bundle"
|
|
|
|
"github.com/databricks/cli/bundle/config/interpolation"
|
|
|
|
"github.com/databricks/cli/bundle/config/mutator"
|
|
|
|
"github.com/databricks/cli/bundle/config/variable"
|
|
|
|
"github.com/databricks/cli/bundle/deploy/terraform"
|
2022-12-12 11:49:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// The initialize phase fills in defaults and connects to the workspace.
|
|
|
|
// Interpolation of fields referring to the "bundle" and "workspace" keys
|
|
|
|
// happens upon completion of this phase.
|
|
|
|
func Initialize() bundle.Mutator {
|
|
|
|
return newPhase(
|
|
|
|
"initialize",
|
|
|
|
[]bundle.Mutator{
|
|
|
|
mutator.PopulateCurrentUser(),
|
2023-01-26 18:55:38 +00:00
|
|
|
mutator.DefineDefaultWorkspaceRoot(),
|
|
|
|
mutator.ExpandWorkspaceRoot(),
|
|
|
|
mutator.DefineDefaultWorkspacePaths(),
|
2023-05-15 09:34:05 +00:00
|
|
|
mutator.SetVariables(),
|
2022-12-12 11:49:25 +00:00
|
|
|
interpolation.Interpolate(
|
|
|
|
interpolation.IncludeLookupsInPath("bundle"),
|
|
|
|
interpolation.IncludeLookupsInPath("workspace"),
|
2023-05-15 09:34:05 +00:00
|
|
|
interpolation.IncludeLookupsInPath(variable.VariableReferencePrefix),
|
2022-12-12 11:49:25 +00:00
|
|
|
),
|
2023-07-12 06:51:54 +00:00
|
|
|
mutator.OverrideCompute(),
|
|
|
|
mutator.ProcessEnvironmentMode(),
|
2023-04-05 14:02:17 +00:00
|
|
|
mutator.TranslatePaths(),
|
2022-12-15 16:30:33 +00:00
|
|
|
terraform.Initialize(),
|
2022-12-12 11:49:25 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|