linux - started work on bunkerized-nginx command
This commit is contained in:
1
tests/index.html
Normal file
1
tests/index.html
Normal file
@@ -0,0 +1 @@
|
||||
ok
|
||||
@@ -7,7 +7,7 @@ function cleanup() {
|
||||
image="$1"
|
||||
|
||||
echo "[*] Run $image"
|
||||
id="$(docker run --rm -d -it "$image")"
|
||||
id="$(docker run --rm -d -it -p 80:80 "$image")"
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "[!] docker run failed"
|
||||
cleanup "$id"
|
||||
@@ -53,3 +53,35 @@ if [ $? -ne 0 ] ; then
|
||||
cleanup "$id"
|
||||
exit 6
|
||||
fi
|
||||
|
||||
echo "[*] Copy variables.env"
|
||||
docker cp "tests/variables.env:$id" /opt/bunkerized-nginx/variables.env
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "[!] docker cp failed"
|
||||
cleanup "$id"
|
||||
exit 7
|
||||
fi
|
||||
|
||||
echo "[*] Copy index.html"
|
||||
docker cp "tests/index.html:$id" /opt/bunkerized-nginx/www
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "[!] docker cp failed"
|
||||
cleanup "$id"
|
||||
exit 8
|
||||
fi
|
||||
|
||||
echo "[*] Exec bunkerized-nginx"
|
||||
docker exec "$id" bunkerized-nginx
|
||||
if [ $? -ne 0 ] || [ "$res" != "ok" ] ; then
|
||||
echo "[!] docker exec failed"
|
||||
cleanup "$id"
|
||||
exit 9
|
||||
fi
|
||||
|
||||
echo "[*] Exec curl"
|
||||
res="$(curl -s http://localhost/")
|
||||
if [ $? -ne 0 ] || [ "$res" != "ok" ] ; then
|
||||
echo "[!] curl failed"
|
||||
cleanup "$id"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
3
tests/variables.env
Normal file
3
tests/variables.env
Normal file
@@ -0,0 +1,3 @@
|
||||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
SERVER_NAME=www.test.com
|
||||
Reference in New Issue
Block a user