mirror of https://github.com/databricks/cli.git
Do not execute build on bundle destroy (#1882)
## Changes There's no value in building artifacts on destroy because they are just removed from workspace as part of destroy.
This commit is contained in:
parent
b6a376bf8a
commit
162aa212bc
|
@ -6,6 +6,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/databricks/cli/bundle"
|
"github.com/databricks/cli/bundle"
|
||||||
|
"github.com/databricks/cli/bundle/config/mutator"
|
||||||
"github.com/databricks/cli/bundle/phases"
|
"github.com/databricks/cli/bundle/phases"
|
||||||
"github.com/databricks/cli/cmd/bundle/utils"
|
"github.com/databricks/cli/cmd/bundle/utils"
|
||||||
"github.com/databricks/cli/cmd/root"
|
"github.com/databricks/cli/cmd/root"
|
||||||
|
@ -62,7 +63,12 @@ func newDestroyCommand() *cobra.Command {
|
||||||
|
|
||||||
diags = bundle.Apply(ctx, b, bundle.Seq(
|
diags = bundle.Apply(ctx, b, bundle.Seq(
|
||||||
phases.Initialize(),
|
phases.Initialize(),
|
||||||
phases.Build(),
|
// We need to resolve artifact variable (how we do it in build phase)
|
||||||
|
// because some of the to-be-destroyed resource might use this variable.
|
||||||
|
// Not resolving might lead to terraform "Reference to undeclared resource" error
|
||||||
|
mutator.ResolveVariableReferences(
|
||||||
|
"artifacts",
|
||||||
|
),
|
||||||
phases.Destroy(),
|
phases.Destroy(),
|
||||||
))
|
))
|
||||||
if err := diags.Error(); err != nil {
|
if err := diags.Error(); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue