Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check to make sure Neo4j started properly.
#!/bin/bash
# Swap out docker-compose for docker run if you like.
docker-compose -f docker-compose.yml up -d
docker-compose ps
SECONDS=0; \
end="$((SECONDS+240))"; \
while true; do \
[[ $(docker-compose -f docker-compose.yml logs --tail=5 neo4j|grep "Remote interface available") ]] \
&& echo "Connected successfully to database." && break; \
[[ "${SECONDS}" -ge "${end}" ]] && echo "Can't connect to database.'" && exit 1; \
sleep 1; \
done
# Run your tests here
#docker run --rm -it -v ${PWD}/packages/neo4j:/usr/src/app -w /usr/src/app optimized/docker-nodejs-dev bash -c "npm install && npm run test"
docker-compose stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment