Skip to content

Commit

Permalink
Fix tests(xdebug, mongodb)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Niebla committed Dec 20, 2021
1 parent 9f0657e commit f3de755
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
10 changes: 3 additions & 7 deletions php-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ ARG INSTALL_GNUPG=false

RUN if [ ${INSTALL_GNUPG} = true ]; then \
apt-get -yq install libgpgme-dev; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install gnupg-1.5.0RC2; \
else \
pecl install gnupg; \
fi; \
pecl install gnupg; \
docker-php-ext-enable gnupg; \
php -m | grep -q 'gnupg'; \
fi
Expand Down Expand Up @@ -221,7 +217,7 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extension
# https://xdebug.org/docs/compat
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] || { [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "4" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "3" ] ;} ;}; then \
pecl install xdebug-3.1.1; \
pecl install xdebug-3.1.2; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install xdebug-2.5.5; \
Expand Down Expand Up @@ -362,7 +358,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
docker-php-ext-enable mongo; \
php -m | grep -oiE '^mongo$'; \
else \
if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ] ;}; then \
pecl install mongodb-1.9.2; \
else \
pecl install mongodb; \
Expand Down
6 changes: 1 addition & 5 deletions php-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ ARG INSTALL_GNUPG=false
RUN set -eux; if [ ${INSTALL_GNUPG} = true ]; then \
apk add --no-cache --no-progress --virtual BUILD_DEPS_PHP_GNUPG gpgme-dev; \
apk add --no-cache --no-progress gpgme; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install gnupg-1.5.0RC2; \
else \
pecl install gnupg; \
fi; \
docker-php-ext-enable gnupg; \
fi

Expand Down Expand Up @@ -147,7 +143,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
docker-php-ext-enable mongo; \
php -m | grep -oiE '^mongo$'; \
else \
if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ] ;}; then \
pecl install mongodb-1.9.2; \
else \
pecl install mongodb; \
Expand Down
20 changes: 6 additions & 14 deletions workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -330,25 +330,17 @@ ARG INSTALL_XDEBUG=false

RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install xdebug-3.0.0; \
# https://xdebug.org/docs/compat
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] || { [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "4" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "3" ] ;} ;}; then \
pecl install xdebug-3.1.2; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install xdebug-2.5.5; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
pecl install xdebug-2.9.0; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \
pecl install xdebug-2.9.8; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
pecl install xdebug-2.9.8; \
else \
#pecl install xdebug; \
echo "xDebug 3 required, not supported."; \
fi \
fi \
pecl install xdebug-2.9.8; \
fi \
fi \
fi && \
Expand Down Expand Up @@ -457,7 +449,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/mongo.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-mongo.ini; \
php -m | grep -oiE '^mongo$'; \
else \
if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ] ;}; then \
pecl install mongodb-1.9.2; \
else \
pecl install mongodb; \
Expand Down

0 comments on commit f3de755

Please sign in to comment.