Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit 322cb20

Browse files
fixed script test + show built images
1 parent 29cbd96 commit 322cb20

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

bin/docker-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ for (( I=0; I<$NLEN; I++ )); do
9191
done
9292

9393
done
94+
95+
docker images

bin/test.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ function test() {
99

1010
FOUND=$(docker image ls -q fabiocicerchia/nginx-lua:$DOCKER_TAG | wc -l)
1111
if [ $FOUND -ne 0 ]; then
12-
docker run -d --name nginx_lua_test -p 8080:80 -v $PWD/test/nginx.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:$DOCKER_TAG \
13-
&& until $(curl --output /dev/null --silent --head --fail http://localhost:8080); do echo -n '.'; sleep 0.5; done \
14-
; curl -v http://localhost:8080 | grep "Welcome to nginx" || exit 1 \
15-
; curl -v http://localhost:8080/lua_content | grep "Hello world" || exit 1 \
16-
; docker rm -f nginx_lua_test
12+
docker run -d --name nginx_lua_test -p 8080:80 -v $PWD/test/nginx.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:$DOCKER_TAG
13+
COUNT=0
14+
until [ $COUNT -eq 20 -o "$(curl --output /dev/null --silent --head --fail http://localhost:8080; echo $?)" == "0" ]; do
15+
echo -n '.'; sleep 0.5;
16+
COUNT=$((COUNT+1))
17+
done
18+
curl -v http://localhost:8080 | grep "Welcome to nginx" || exit 1
19+
curl -v http://localhost:8080/lua_content | grep "Hello world" || exit 1
20+
docker rm -f nginx_lua_test
1721
else
1822
echo "Image not found: fabiocicerchia/nginx-lua:$DOCKER_TAG"
1923
fi

0 commit comments

Comments
 (0)