@@ -320,7 +320,7 @@ jobs:
320
320
321
321
- name : Check if Talawa API starts in Docker
322
322
run : |
323
- # Ensure no containers are running
323
+ # Ensure no containers are running
324
324
docker-compose -f docker-compose.dev.yaml down -v || true
325
325
326
326
# Verify docker-compose file exists
@@ -339,7 +339,7 @@ jobs:
339
339
# Wait for MongoDB and Redis to be ready
340
340
echo "Waiting for MongoDB..."
341
341
timeout=30
342
- until docker-compose -f docker-compose.dev.yaml exec -T mongodb mongo --eval "db.runCommand('ping').ok">/dev/null 2>&1 || [ $timeout -eq 0]; do
342
+ until docker-compose -f docker-compose.dev.yaml exec -T mongodb mongo --eval "db.runCommand('ping').ok">/dev/null 2>&1 || [ $timeout -eq 0 ]; do
343
343
sleep 1
344
344
((timeout--))
345
345
done
@@ -366,19 +366,19 @@ jobs:
366
366
# Wait for TALAWA API to be healthy
367
367
timeout=60
368
368
until docker-compose -f docker-compose.dev.yaml exec -T talawa-api-dev curl -sf "http://localhost:4000/health" 2>&1 || [ $timeout -eq 0 ]; do
369
- echo "Waiting for API to start... ($timeout seconds remaining)"
370
- sleep 1
371
- ((timeout--))
372
- done
369
+ echo "Waiting for API to start... ($timeout seconds remaining)"
370
+ sleep 1
371
+ ((timeout--))
372
+ done
373
373
374
- if [ $timeout -eq 0 ]; then
375
- echo "Error : API failed to start within timeout"
376
- docker-compose -f docker-compose.dev.yaml logs
377
- docker-compose -f docker-compose.dev.yaml down -v
378
- exit 1
379
- fi
374
+ if [ $timeout -eq 0 ]; then
375
+ echo "Error: API failed to start within timeout"
376
+ docker-compose -f docker-compose.dev.yaml logs
377
+ docker-compose -f docker-compose.dev.yaml down -v
378
+ exit 1
379
+ fi
380
380
381
- echo "API started successfully"
381
+ echo "API started successfully"
382
382
383
383
# Ensure cleanup runs even if the script fails
384
384
cleanup() {
@@ -387,7 +387,8 @@ jobs:
387
387
if ! docker-compose -f docker-compose.dev.yaml down -v; then
388
388
echo "Warning : Failed to cleanup containers"
389
389
fi
390
- exit $exit_code }
390
+ exit $exit_code
391
+ }
391
392
392
393
trap cleanup EXIT
393
394
env :
0 commit comments