-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
61 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
cleanup() { | ||
if docker ps -a --filter "name=nginx-test" | grep nginx-test &>/dev/null; then | ||
echo "Removing nginx-test container..." | ||
docker stop nginx-test &>/dev/null && docker rm nginx-test &>/dev/null | ||
else | ||
echo "No nginx-test container found." | ||
fi | ||
|
||
if docker images nginx-test-img | grep nginx-test-img &>/dev/null; then | ||
echo "Removing nginx-test-img image..." | ||
docker rmi nginx-test-img &>/dev/null | ||
else | ||
echo "No nginx-test-img image found." | ||
fi | ||
} | ||
|
||
docker build -t nginx-test-img -f Dockerfile-test . | ||
docker run --name nginx-test -e NGINX_CONFIG_FILE=/nginx.conf -d nginx-test-img | ||
sleep 3 | ||
|
||
for i in http stream ; do | ||
echo "Curling $i server listener..." | ||
docker exec nginx-test sh nginx-test.sh $i | ||
if [[ $? -ne 0 ]]; then | ||
echo "ERROR: Failed curl on $i listener" | ||
cleanup | ||
exit 1 | ||
else | ||
echo "Passed $i check" | ||
fi | ||
done | ||
cleanup | ||
echo "Success!" | ||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if [[ $@ == "http" ]]; then | ||
curl -sf localhost:10080 | ||
if [[ $? -ne 0 ]]; then | ||
return 1 | ||
fi | ||
elif [[ $@ == "stream" ]]; then | ||
curl -sf localhost:10081 | ||
if [[ $? -ne 52 ]]; then | ||
return 1 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters