mirror of https://github.com/codevalet/master
Add a little connectivity helper script to ensure we can clean-start tests
This commit is contained in:
parent
b3c059e230
commit
7d77024b85
|
@ -4,6 +4,7 @@ all: check
|
|||
|
||||
check: bats container
|
||||
docker-compose up --remove-orphans -d
|
||||
./test/check-connectivity
|
||||
./bats/bin/bats test/*.bats
|
||||
|
||||
bats:
|
||||
|
@ -12,10 +13,13 @@ bats:
|
|||
container: Dockerfile nginx.conf supervisord.conf
|
||||
docker build -t $(IMAGE_NAME):latest .
|
||||
|
||||
# Whenever the nginx.conf changes, we should down the docker-compose bits just
|
||||
# to ensure we come up with something new
|
||||
nginx.conf:
|
||||
docker-compose down
|
||||
|
||||
clean: ensure-down
|
||||
clean:
|
||||
docker-compose down
|
||||
docker rmi $(shell docker images -q -f "reference=$(IMAGE_NAME)")
|
||||
rm -rf bats
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PROXY_URL=http://127.0.0.1:8081/
|
||||
|
||||
for i in $(seq 1 5); do
|
||||
curl -sI ${PROXY_URL} 2>&1 > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
sleep 1
|
||||
else
|
||||
exit 0
|
||||
fi;
|
||||
done;
|
||||
|
||||
# If we get to here without having bailed out, something is wrong
|
||||
exit 1
|
Loading…
Reference in New Issue