Skip to content

Instantly share code, notes, and snippets.

@noeljackson
Last active October 4, 2017 10:28
Show Gist options
  • Save noeljackson/e10e135669e04c4b56bc61db5b802ba9 to your computer and use it in GitHub Desktop.
Save noeljackson/e10e135669e04c4b56bc61db5b802ba9 to your computer and use it in GitHub Desktop.
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