Skip to content

Commit

Permalink
Test against available php modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Dec 27, 2018
1 parent b37afe3 commit ddbe0f9
Show file tree
Hide file tree
Showing 8 changed files with 348 additions and 25 deletions.
8 changes: 8 additions & 0 deletions .tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ PROJECT = vhost-tests
VHOST = $(PROJECT).loc


# -------------------------------------------------------------------------------------------------
# Misc Targets
# -------------------------------------------------------------------------------------------------
update-readme:
cat "../README.md" \
| perl -00 -pe "s/<!-- modules -->.*<!-- \/modules -->/<!-- modules -->\n$$(./get-modules.sh)\n<!-- \/modules -->/s" \
> "../README.md"

# -------------------------------------------------------------------------------------------------
# Testing Targets
# -------------------------------------------------------------------------------------------------
Expand Down
229 changes: 229 additions & 0 deletions .tests/get-modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
#!/usr/bin/env bash

###
### Get PHP modules (5 rounds)
###

if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 5.2"
exit 1
fi
fi
fi
fi
fi
if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 5.3"
exit 1
fi
fi
fi
fi
fi
if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 5.4"
exit 1
fi
fi
fi
fi
fi
if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 5.5"
exit 1
fi
fi
fi
fi
fi
if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 5.6"
exit 1
fi
fi
fi
fi
fi
if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 7.0"
exit 1
fi
fi
fi
fi
fi
if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 7.1"
exit 1
fi
fi
fi
fi
fi
if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 7.2"
exit 1
fi
fi
fi
fi
fi
if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 7.3"
exit 1
fi
fi
fi
fi
fi
if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
sleep 5;
if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then
>&2 echo "Failed to retrieve modules for PHP 7.4"
exit 1
fi
fi
fi
fi
fi

ALL="$( echo "${PHP52}, ${PHP53}, ${PHP54}, ${PHP55}, ${PHP56}, ${PHP70}, ${PHP71}, ${PHP72}, ${PHP73}, ${PHP74}" | sed 's/,/\n/g' | sed -e 's/^\s*//g' -e 's/\s*$//g' | sort -u )"

Y=""

echo "| Modules | PHP 5.2 | PHP 5.3 | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 |"
echo "|----------------|---------|---------|---------|---------|---------|---------|---------|---------|---------|---------|"
echo "${ALL}" | while read line; do
printf "| %-15s%s" "${line}" "|"

if echo ",${PHP52}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP53}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP54}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP55}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP56}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP70}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP71}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP72}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP73}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi
if echo ",${PHP74}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then
printf " %s |" "${Y}"
else
printf " |"
fi

printf "\n"
done
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ services:
### Specify combinations
###
env:
###
### Check PHP Modules
###
- S1=MODULES

###
### Check Documentation
###
Expand Down Expand Up @@ -196,7 +201,7 @@ env:
###
install:
# Update Debian/Ubuntu package index
- if [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then
- if [ "${S1}" != "MODULES" ] && [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then
until sudo apt-get update -qq; do sleep 5; done
fi

Expand Down Expand Up @@ -227,7 +232,7 @@ install:
echo "${COMPOSE_VERSION}";

# Install Docker and Docker Compose
- if [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then
- if [ "${S1}" != "MODULES" ] && [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then
until sudo apt-get -y -qq -o Dpkg::Options::="--force-confnew" install docker-ce${DOCKER_APT}; do sleep 5; done;
until curl -L -sS https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose; do sleep 5; done;
chmod +x docker-compose;
Expand Down Expand Up @@ -270,7 +275,11 @@ before_script:
### Test
###
script:
- if [ "${S1}" = "DOCUMENTATION" ]; then
- if [ "${S1}" = "MODULES" ]; then
cd .tests/;
make update-readme;
git diff --quiet || { echo "Build Changes"; git diff; git status; false; }
elif [ "${S1}" = "DOCUMENTATION" ]; then
cd docs/;
make build;
make linkcheck;
Expand Down
Loading

0 comments on commit ddbe0f9

Please sign in to comment.