Upload terraform state even if apply fails (#923)

## Changes
Upload terraform state even if apply fails

Fixes #893 

## Tests
Manually running `databricks bundle deploy` with incorrect permissions
in bundle config and observe that it gets uploaded correctly
This commit is contained in:
Andrew Nester 2023-10-26 16:38:01 +02:00 committed by GitHub
parent 9b16e9bd45
commit 19e00d2d47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -29,9 +29,11 @@ func Deploy() bundle.Mutator {
terraform.Interpolate(), terraform.Interpolate(),
terraform.Write(), terraform.Write(),
terraform.StatePull(), terraform.StatePull(),
bundle.Defer(
terraform.Apply(), terraform.Apply(),
terraform.StatePush(), terraform.StatePush(),
), ),
),
lock.Release(lock.GoalDeploy), lock.Release(lock.GoalDeploy),
), ),
scripts.Execute(config.ScriptPostDeploy), scripts.Execute(config.ScriptPostDeploy),