Skip to content

Commit 6329f1c

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.
1 parent 8d9e620 commit 6329f1c

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
@@ -177,7 +177,17 @@ jobs:
177177
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
178178

179179
- name: Terraform Apply
180-
run: terraform apply -auto-approve
180+
run: |
181+
for attempt in $(seq 5); do
182+
if terraform apply -auto-approve; then
183+
echo "Created infrastructure on attempt $attempt"
184+
break
185+
fi
186+
echo "Failed to create infrastructure on attempt $attempt"
187+
sleep 10
188+
terraform destroy -auto-approve
189+
sleep 60
190+
done
181191
working-directory: ${{ github.workspace }}/terraform/aio
182192
env:
183193
OS_CLOUD: ${{ inputs.OS_CLOUD }}

0 commit comments

Comments
 (0)