-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from cleydyr/issue-222
#222 remake the validation with a real server running
- Loading branch information
Showing
2 changed files
with
16 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#!/bin/bash | ||
rootPath=$PWD/../nginx/conf.d/biblivre.conf | ||
nginxVersion=latest | ||
|
||
result=`docker run --rm -t -a stdout --name tmp-nginx -v $PWD/nginx/conf.d/:/etc/nginx/conf.d:ro nginx nginx -c /etc/nginx/nginx.conf -t` | ||
docker network create tmp >> /dev/null | ||
|
||
# Look for the word successful and count the lines that have it | ||
# This validation could be improved if needed | ||
successful=$(echo $result | grep successful | wc -l) | ||
docker run --network tmp -t --rm -d --name app tomcat:9-jdk8 >> /dev/null | ||
docker run --network tmp --rm -t -a stdout --name tmp-nginx -v $PWD/nginx/conf.d/:/etc/nginx/conf.d:ro nginx nginx -c /etc/nginx/nginx.conf -t | ||
|
||
if [ $successful = 0 ]; then | ||
exitCode=$? | ||
|
||
if [ $exitCode -ne 0 ]; then | ||
echo FAILED | ||
echo "$result" | ||
exit 1 | ||
else | ||
echo SUCCESS | ||
exit 0 | ||
fi | ||
|
||
docker stop app >> /dev/null | ||
docker network rm tmp >> /dev/null | ||
|
||
exit $exitCode |