-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (47 loc) · 1.86 KB
/
Copy pathdocker-compose-integration.yml
File metadata and controls
57 lines (47 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Docker Compose Integration
on:
pull_request:
branches: [ main ]
jobs:
docker-compose-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Start services
run: docker compose up -d
- name: Wait for services to be healthy
run: |
echo "Waiting for all services to be healthy..."
# Wait for services with health checks to be healthy (4 services) and all services to be up
timeout 300 bash -c 'until [ $(docker compose ps --format "{{.Health}}" | grep -c "healthy") -ge 4 ] && [ $(docker compose ps --format "{{.Status}}" | grep -c "Up") -ge 5 ]; do sleep 5; done'
docker compose ps
- name: Test health endpoints
run: |
curl -f http://localhost:8080/health || exit 1
curl -f http://localhost:8081/dashboard/ || exit 1
curl -f http://localhost:8082 || exit 1
- name: Test API endpoints
run: |
# Test basic connectivity to services through Traefik
curl -f -X GET "http://localhost:8080/api/award/health" || exit 1
curl -f -X GET "http://localhost:8080/api/users/health" || exit 1
- name: Show service logs on failure
if: failure()
run: |
echo "=== Docker Compose Services Status ==="
docker compose ps
echo "=== Traefik Logs ==="
docker compose logs traefik
echo "=== Sticker Award Logs ==="
docker compose logs sticker-award
echo "=== User Management Logs ==="
docker compose logs user-management
echo "=== Database Logs ==="
docker compose logs sticker-award-db
docker compose logs user-management-db
- name: Cleanup
if: always()
run: docker compose down -v