This repository was archived by the owner on Jan 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ source supported_versions
5
5
function test() {
6
6
DOCKER_TAG=$1
7
7
8
- docker image ls -q fabiocicerchia/nginx:$DOCKER_TAG \
9
- || (docker run -d --name nginx_lua_test -p 8080:80 -v $PWD /test/nginx.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:$DOCKER_TAG \
10
- && until $( curl --output /dev/null --silent --head --fail http://localhost:8080) ; do echo -n ' .' ; sleep 0.5; done \
11
- ; curl -v http://localhost:8080 | grep " Welcome to nginx" || exit 1 \
12
- ; curl -v http://localhost:8080/lua_content | grep " Hello world" || exit 1 \
13
- ; docker rm -f nginx_lua_test)
8
+ docker rm -f nginx_lua_test 2> /dev/null
9
+
10
+ FOUND=$( docker image ls -q fabiocicerchia/nginx-lua:$DOCKER_TAG | wc -l)
11
+ 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
17
+ else
18
+ echo " Image not found: fabiocicerchia/nginx-lua:$DOCKER_TAG "
19
+ fi
14
20
}
15
21
16
22
function runtest() {
You can’t perform that action at this time.
0 commit comments