Skip to content

Commit

Permalink
Fix filby permissions
Browse files Browse the repository at this point in the history
Check for test containers to be ready
  • Loading branch information
cressie176 committed Jan 27, 2024
1 parent 4cd60b8 commit abe82a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
npm run lint-staged
docker compose down
npm run docker
containers=("fby_js_example" "fby_ts_example" "fby_test")
for container in "${containers[@]}"; do
attempts=1
max=5
for i in {0..5}; do
echo "Checking ${container} ${attempts}/${max}"
if docker exec "$container" pg_isready -U fby_example; then
break
else
sleep 1
((attempts++))
fi
done

if [ "$attempts" -gt 5 ]; then
echo "Connection to ${container} failed after ${max} retries"
exit 1
fi
done
pushd examples/javascript && npm test && popd
pushd examples/typescript && npm test && popd
npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
"url": "https://github.com/acuminous/filby/issues"
},
"homepage": "https://acuminous.github.io/filby"
}
}

0 comments on commit abe82a9

Please sign in to comment.