Skip to content

Commit a56a95c

Browse files
committed
CI: Add retries to TF apply in aio job
We sometimes hit temporary failures during VM creation. Adding a retry may help to keep things running. (cherry picked from commit 6329f1c)
1 parent 5fcd75f commit a56a95c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,17 @@ jobs:
154154
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
155155

156156
- name: Terraform Apply
157-
run: terraform apply -auto-approve
157+
run: |
158+
for attempt in $(seq 5); do
159+
if terraform apply -auto-approve; then
160+
echo "Created infrastructure on attempt $attempt"
161+
break
162+
fi
163+
echo "Failed to create infrastructure on attempt $attempt"
164+
sleep 10
165+
terraform destroy -auto-approve
166+
sleep 60
167+
done
158168
working-directory: ${{ github.workspace }}/terraform/aio
159169
env:
160170
OS_CLOUD: ${{ inputs.OS_CLOUD }}

0 commit comments

Comments
 (0)