2022-12-12 11:49:25 +00:00
|
|
|
package phases
|
|
|
|
|
|
|
|
import (
|
2023-05-16 16:35:39 +00:00
|
|
|
"github.com/databricks/cli/bundle"
|
2023-09-14 10:14:13 +00:00
|
|
|
"github.com/databricks/cli/bundle/config"
|
2023-05-16 16:35:39 +00:00
|
|
|
"github.com/databricks/cli/bundle/config/interpolation"
|
|
|
|
"github.com/databricks/cli/bundle/config/mutator"
|
|
|
|
"github.com/databricks/cli/bundle/config/variable"
|
2023-12-19 07:38:52 +00:00
|
|
|
"github.com/databricks/cli/bundle/deploy/metadata"
|
2023-05-16 16:35:39 +00:00
|
|
|
"github.com/databricks/cli/bundle/deploy/terraform"
|
2023-11-13 11:29:40 +00:00
|
|
|
"github.com/databricks/cli/bundle/permissions"
|
2023-09-27 08:26:59 +00:00
|
|
|
"github.com/databricks/cli/bundle/python"
|
2023-09-14 10:14:13 +00:00
|
|
|
"github.com/databricks/cli/bundle/scripts"
|
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{
|
2023-11-30 14:28:01 +00:00
|
|
|
mutator.InitializeWorkspaceClient(),
|
2022-12-12 11:49:25 +00:00
|
|
|
mutator.PopulateCurrentUser(),
|
2023-08-23 16:47:07 +00:00
|
|
|
mutator.SetRunAs(),
|
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(),
|
2023-08-17 15:22:32 +00:00
|
|
|
mutator.ProcessTargetMode(),
|
2023-10-04 13:23:13 +00:00
|
|
|
mutator.ExpandPipelineGlobPaths(),
|
2023-04-05 14:02:17 +00:00
|
|
|
mutator.TranslatePaths(),
|
2023-09-27 08:26:59 +00:00
|
|
|
python.WrapperWarning(),
|
2023-11-13 11:29:40 +00:00
|
|
|
permissions.ApplyBundlePermissions(),
|
2023-12-19 07:38:52 +00:00
|
|
|
metadata.AnnotateJobs(),
|
2022-12-15 16:30:33 +00:00
|
|
|
terraform.Initialize(),
|
2023-09-14 10:14:13 +00:00
|
|
|
scripts.Execute(config.ScriptPostInit),
|
2022-12-12 11:49:25 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|