Skip to content

Commit caa64e1

Browse files
committed
Add retry logic for starting databases in GitHub Actions workflow
1 parent 533c284 commit caa64e1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/github-actions.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ jobs:
3939
- shell: pwsh
4040
run: |
4141
./downloadBackupAndJDBCDrivers.ps1
42-
- run: docker-compose -f "./docker/docker-compose.yml" up -d
42+
- name: Start databases (retry on public.ecr.aws rate limiting)
43+
shell: bash
44+
run: |
45+
for i in 1 2 3 4 5; do
46+
docker-compose -f "./docker/docker-compose.yml" up -d && exit 0
47+
echo "compose up attempt $i failed (likely toomanyrequests); retrying in 30s..."
48+
sleep 30
49+
done
50+
echo "compose up failed after 5 attempts" >&2
51+
exit 1
4352
- shell: pwsh
4453
run: |
4554
./restoreBackup.ps1

0 commit comments

Comments
 (0)