Skip to content

Commit 7ef2292

Browse files
committed
remove the empty local tfstate after deletion
- otherwise terraform init will upload an empty state to the bucket
1 parent 5ce4017 commit 7ef2292

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

destroy.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ function workstation::delete() {
7373
-var "vm_name=${vm_name}" \
7474
-var "project=${gcp_project}"
7575

76+
rm .terraform/terraform.tfstate
77+
7678
popd > /dev/null
7779
}
7880

@@ -84,7 +86,7 @@ function tfstate::delete() {
8486
service_account_json="${2}"
8587

8688
gcloud auth activate-service-account --key-file="${service_account_json}"
87-
gsutil rm -rf "gs://cf-buildpacks-workstations/${vm_name}"
89+
gsutil rm -r "gs://cf-buildpacks-workstations/${vm_name}"
8890
}
8991

9092
main "${@:-}"

0 commit comments

Comments
 (0)