2022-12-12 11:49:25 +00:00
|
|
|
package phases
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/databricks/bricks/bundle"
|
|
|
|
"github.com/databricks/bricks/bundle/artifacts"
|
2023-02-20 18:42:55 +00:00
|
|
|
"github.com/databricks/bricks/bundle/deploy/files"
|
2023-03-22 15:37:26 +00:00
|
|
|
"github.com/databricks/bricks/bundle/deploy/lock"
|
2022-12-12 11:49:25 +00:00
|
|
|
"github.com/databricks/bricks/bundle/deploy/terraform"
|
|
|
|
)
|
|
|
|
|
|
|
|
// The deploy phase deploys artifacts and resources.
|
|
|
|
func Deploy() bundle.Mutator {
|
|
|
|
return newPhase(
|
|
|
|
"deploy",
|
|
|
|
[]bundle.Mutator{
|
2023-03-22 15:37:26 +00:00
|
|
|
lock.Acquire(),
|
2023-02-20 18:42:55 +00:00
|
|
|
files.Upload(),
|
2022-12-12 11:49:25 +00:00
|
|
|
artifacts.UploadAll(),
|
|
|
|
terraform.Interpolate(),
|
|
|
|
terraform.Write(),
|
2023-03-30 10:01:09 +00:00
|
|
|
terraform.StatePull(),
|
2023-04-19 23:00:53 +00:00
|
|
|
terraform.Plan(terraform.PlanDeploy),
|
2023-04-19 13:14:26 +00:00
|
|
|
terraform.ShowPlan(),
|
2023-04-19 23:00:53 +00:00
|
|
|
terraform.Apply(terraform.ApplyDeploy),
|
2023-03-30 10:01:09 +00:00
|
|
|
terraform.StatePush(),
|
2023-03-22 15:37:26 +00:00
|
|
|
lock.Release(),
|
2022-12-12 11:49:25 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|