Retry with different port and more verbose error output

This commit is contained in:
cytopia
2018-03-04 12:16:33 +01:00
parent 8b5bd53bf3
commit 5afb68cc22
2 changed files with 22 additions and 8 deletions

View File

@@ -42,17 +42,21 @@ install:
# Disable services enabled by default
# http://docs.travis-ci.com/user/database-setup/#MySQL
- sudo /etc/init.d/mysql stop || true
- sudo /etc/init.d/postgresql stop || true
- sudo /etc/init.d/httpd stop || true
- sudo /etc/init.d/memcached stop || true
- sudo /etc/init.d/redis stop || true
- sudo /etc/init.d/mongodb stop || true
- sudo /etc/init.d/mysql stop || true
- sudo /etc/init.d/nginx stop || true
- sudo /etc/init.d/postgresql stop || true
- sudo /etc/init.d/redis stop || true
- sudo service mysql stop || true
- sudo service postgresql stop || true
- sudo service httpd stop || true
- sudo service memcached stop || true
- sudo service redis stop || true
- sudo service mongodb stop || true
- sudo service mysql stop || true
- sudo service nginx stop || true
- sudo service postgresql stop || true
- sudo service redis stop || true
- netstat -tulpn

View File

@@ -22,7 +22,7 @@ FLAVOUR="${3}"
###
### Test Nginx with PHP-FPM
###
WWW_PORT="23254"
WWW_PORT="81"
DOC_ROOT_HOST="$( mktemp -d )"
DOC_ROOT_CONT="/var/www/default"
@@ -65,9 +65,19 @@ ndid="$( docker_run "${CONTAINER}" "-v ${DOC_ROOT_HOST}:${DOC_ROOT_CONT} -v ${CO
run "sleep 10"
# Check PHP connectivity
if ! run "curl -q localhost:${WWW_PORT}/index.php 2>&1 | grep '${FINDME}'"; then
if ! run "curl -q http://localhost:${WWW_PORT}/index.php 2>&1 | grep '${FINDME}'"; then
# Show logs
docker_logs "${ndid}" || true
docker_logs "${did}" || true
# Ensure file is available
docker_exec "${ndid}" "cat ${DOC_ROOT_CONT}/index.php"
docker_exec "${did}" "cat ${DOC_ROOT_CONT}/index.php"
# Nginx configuration
docker_exec "${ndid}" "cat ${CONFIG_CONT}/php.conf"
# Shutdown
docker_stop "${ndid}" || true
docker_stop "${did}" || true
rm -rf "${DOC_ROOT_HOST}"