File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,19 @@ jobs:
371
371
if : ${{ steps.config_ach.outcome == 'success' && contains(fromJSON('["success", "always"]'), inputs.break_on) }}
372
372
373
373
- name : Destroy
374
- run : terraform destroy -auto-approve -input=false
374
+ run : |
375
+ for attempt in $(seq 3); do
376
+ if terraform destroy -auto-approve -input=false -lock-timeout=100s; then
377
+ echo "Destroyed infrastructure on attempt $attempt"
378
+ exit 0
379
+ fi
380
+ echo "Failed to destroy infrastructure on attempt $attempt"
381
+ sleep 60
382
+ done
383
+ echo "Failed to destroy infrastructure after $attempt attempts"
384
+ echo "Forcefully destroying infrastructure"
385
+ terraform destroy -auto-approve -input=false -lock=false
386
+ exit 1
375
387
working-directory : ${{ github.workspace }}/terraform-kayobe-multinode
376
388
env :
377
389
OS_CLOUD : ${{ vars.OS_CLOUD }}
You can’t perform that action at this time.
0 commit comments