Skip to content

Commit 06f504c

Browse files
authored
Add retries to CI tofu apply (#833)
1 parent b540bfd commit 06f504c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/stackhpc.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ jobs:
107107
. venv/bin/activate
108108
. environments/.stackhpc/activate
109109
cd "$STACKHPC_TF_DIR"
110-
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
110+
max_retries=3
111+
delay=30
112+
for i in $(seq 1 $max_retries); do
113+
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" && break
114+
[ "$i" -lt "$max_retries" ] && sleep $delay || exit 1
115+
done
111116
112117
- name: Delete infrastructure if provisioning failed
113118
run: |

0 commit comments

Comments
 (0)