2022-12-12 11:49:25 +00:00
|
|
|
package phases
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/databricks/bricks/bundle"
|
|
|
|
"github.com/databricks/bricks/bundle/config/interpolation"
|
|
|
|
"github.com/databricks/bricks/bundle/config/mutator"
|
2022-12-15 16:30:33 +00:00
|
|
|
"github.com/databricks/bricks/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(),
|
2022-12-12 11:49:25 +00:00
|
|
|
interpolation.Interpolate(
|
|
|
|
interpolation.IncludeLookupsInPath("bundle"),
|
|
|
|
interpolation.IncludeLookupsInPath("workspace"),
|
|
|
|
),
|
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
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|