Add tests for nginx.conf directives #1
9
test.sh
9
test.sh
@ -3,8 +3,6 @@
|
|||||||
image=miti.sh
|
image=miti.sh
|
||||||
loopback=127.0.0.1
|
loopback=127.0.0.1
|
||||||
|
|
||||||
echo "Starting test container..."
|
|
||||||
|
|
||||||
# Make sure to create 'no-internet' network, if it doesn't already exist:
|
# Make sure to create 'no-internet' network, if it doesn't already exist:
|
||||||
# $ docker network create --internal no-internet
|
# $ docker network create --internal no-internet
|
||||||
container_id=$(docker run --rm -d -v $(pwd):/opt/app --network no-internet \
|
container_id=$(docker run --rm -d -v $(pwd):/opt/app --network no-internet \
|
||||||
@ -16,19 +14,12 @@ container_id=$(docker run --rm -d -v $(pwd):/opt/app --network no-internet \
|
|||||||
--add-host=apps.webdevcat.me=$loopback \
|
--add-host=apps.webdevcat.me=$loopback \
|
||||||
$image)
|
$image)
|
||||||
|
|
||||||
echo "Test container started"
|
|
||||||
|
|
||||||
# docker exec -t $container_id cat /etc/hosts
|
|
||||||
# docker exec -t $container_id cat /opt/app/logs/error.log
|
|
||||||
docker exec -t $container_id busted
|
docker exec -t $container_id busted
|
||||||
|
|
||||||
echo "Stopping test container"
|
|
||||||
docker exec $container_id openresty -p /opt/app -s stop
|
docker exec $container_id openresty -p /opt/app -s stop
|
||||||
|
|
||||||
is_running=$(docker inspect -f '{{.State.Running}}' $container_id)
|
is_running=$(docker inspect -f '{{.State.Running}}' $container_id)
|
||||||
|
|
||||||
if [[ $is_running == "true" ]]; then
|
if [[ $is_running == "true" ]]; then
|
||||||
echo "Warning: Docker reports test container is still running"
|
echo "Warning: Docker reports test container is still running"
|
||||||
else
|
|
||||||
echo "Test container stopped"
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user