Skip to content

Commit

Permalink
indentation 1
Browse files Browse the repository at this point in the history
  • Loading branch information
prayanshchh committed Dec 14, 2024
1 parent cfec867 commit 1544502
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ jobs:
- name: Check if Talawa API starts in Docker
run : |
# Ensure no containers are running
# Ensure no containers are running
docker-compose -f docker-compose.dev.yaml down -v || true
# Verify docker-compose file exists
Expand All @@ -339,7 +339,7 @@ jobs:
# Wait for MongoDB and Redis to be ready
echo "Waiting for MongoDB..."
timeout=30
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
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
sleep 1
((timeout--))
done
Expand All @@ -366,19 +366,19 @@ jobs:
# Wait for TALAWA API to be healthy
timeout=60
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
echo "Waiting for API to start... ($timeout seconds remaining)"
sleep 1
((timeout--))
done
echo "Waiting for API to start... ($timeout seconds remaining)"
sleep 1
((timeout--))
done
if [ $timeout -eq 0 ]; then
echo "Error: API failed to start within timeout"
docker-compose -f docker-compose.dev.yaml logs
docker-compose -f docker-compose.dev.yaml down -v
exit 1
fi
if [ $timeout -eq 0 ]; then
echo "Error: API failed to start within timeout"
docker-compose -f docker-compose.dev.yaml logs
docker-compose -f docker-compose.dev.yaml down -v
exit 1
fi
echo "API started successfully"
echo "API started successfully"
# Ensure cleanup runs even if the script fails
cleanup() {
Expand All @@ -387,7 +387,8 @@ jobs:
if ! docker-compose -f docker-compose.dev.yaml down -v; then
echo "Warning: Failed to cleanup containers"
fi
exit $exit_code }
exit $exit_code
}

trap cleanup EXIT
env:
Expand Down

0 comments on commit 1544502

Please sign in to comment.