From c4b051183a3aefb814af1e39e54c5bb7f996b2dd Mon Sep 17 00:00:00 2001 From: Gleb Tcivie Date: Wed, 10 Jul 2024 09:29:47 +0300 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f49f4e7..1681232 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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