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/artifacts"
|
|
|
|
"github.com/databricks/cli/bundle/deploy/files"
|
|
|
|
"github.com/databricks/cli/bundle/deploy/lock"
|
|
|
|
"github.com/databricks/cli/bundle/deploy/terraform"
|
2022-12-12 11:49:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// The deploy phase deploys artifacts and resources.
|
|
|
|
func Deploy() bundle.Mutator {
|
2023-05-24 12:45:19 +00:00
|
|
|
deployMutator := bundle.Seq(
|
2023-05-16 16:01:50 +00:00
|
|
|
lock.Acquire(),
|
2023-05-24 12:45:19 +00:00
|
|
|
bundle.Defer(
|
|
|
|
bundle.Seq(
|
|
|
|
files.Upload(),
|
|
|
|
artifacts.UploadAll(),
|
|
|
|
terraform.Interpolate(),
|
|
|
|
terraform.Write(),
|
|
|
|
terraform.StatePull(),
|
|
|
|
terraform.Apply(),
|
|
|
|
terraform.StatePush(),
|
|
|
|
),
|
|
|
|
lock.Release(),
|
|
|
|
),
|
|
|
|
)
|
2023-05-16 16:01:50 +00:00
|
|
|
|
2022-12-12 11:49:25 +00:00
|
|
|
return newPhase(
|
|
|
|
"deploy",
|
2023-05-24 12:45:19 +00:00
|
|
|
[]bundle.Mutator{deployMutator},
|
2022-12-12 11:49:25 +00:00
|
|
|
)
|
|
|
|
}
|