Update main.yml
This commit is contained in:
parent
a8be85e20c
commit
c4b051183a
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
|||
- name: Wait for containers to start
|
||||
run: sleep 60 # 1 Minute
|
||||
|
||||
- name: Check container statuses
|
||||
- name: Check container statuses and logs
|
||||
run: |
|
||||
services=("prometheus" "grafana" "exporter" "postgres")
|
||||
|
||||
|
@ -27,6 +27,7 @@ jobs:
|
|||
|
||||
if [ -z "$container_id" ]; then
|
||||
echo "Error: Container for $service not found"
|
||||
docker-compose logs $service
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -35,11 +36,15 @@ jobs:
|
|||
|
||||
if [ "$status" != "running" ]; then
|
||||
echo "Error: Container $service ($container_id) is not running. Current status: $status"
|
||||
echo "Last logs for $service:"
|
||||
docker-compose logs --tail=50 $service
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$restarts" -gt 0 ]; then
|
||||
echo "Error: Container $service ($container_id) has restarted $restarts times"
|
||||
echo "Last logs for $service:"
|
||||
docker-compose logs --tail=50 $service
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue