Disable Xdebug in push builds to speed them up

This commit is contained in:
Ben Ramsey
2020-01-29 13:16:20 -06:00
parent 8dc64d99ff
commit 52cbbe34be
5 changed files with 30 additions and 4 deletions
+1
View File
@@ -47,6 +47,7 @@ before_install:
- ./resources/scripts/cmd-proxy.sh ./resources/scripts/system-info.sh
install:
- [ "${TRAVIS_EVENT_TYPE}" != "cron" ] && phpenv config-rm xdebug.ini
- travis_retry ./resources/scripts/cmd-proxy.sh composer require --no-update "php-coveralls/php-coveralls:^1 | ^2"
- travis_retry ./resources/scripts/cmd-proxy.sh composer install --no-interaction --prefer-dist --no-progress --no-suggest
+5 -2
View File
@@ -3,6 +3,8 @@ ARG ARCH
FROM ${ARCH}/php:${PHP_VERSION}-cli-alpine
ARG XDEBUG
RUN apk update \
&& apk add --virtual=builddeps autoconf g++ gcc libc6-compat make re2c \
&& apk add \
@@ -15,8 +17,9 @@ RUN apk update \
&& docker-php-ext-install -j$(nproc) bcmath gmp zip \
&& yes '' | pecl install libsodium-1.0.7 \
&& yes '' | pecl install uuid \
&& yes '' | pecl install xdebug \
&& docker-php-ext-enable libsodium uuid xdebug \
&& docker-php-ext-enable libsodium uuid \
&& if [ "${XDEBUG}" == "yes" ]; then yes '' | pecl install xdebug; fi \
&& if [ "${XDEBUG}" == "yes" ]; then docker-php-ext-enable xdebug; fi \
&& apk del builddeps
COPY composer-install.sh /usr/local/bin/composer-install.sh
+13 -1
View File
@@ -2,9 +2,21 @@
PHP_VERSION=$1
ARCH=$2
XDEBUG=${3:-no}
xdebug_tag="-without-xdebug"
if [ "${XDEBUG}" == "yes" ]; then
xdebug_tag=""
fi
build_tag="benramsey/ramsey-uuid:php-${PHP_VERSION}-${ARCH}${xdebug_tag}"
docker build \
--tag benramsey/ramsey-uuid:php-${PHP_VERSION}-${ARCH} \
--tag ${build_tag} \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg ARCH=${ARCH} \
--build-arg XDEBUG=${XDEBUG} \
.
docker run --rm ${build_tag} php -v
docker run --rm ${build_tag} composer --version --ansi
+7 -1
View File
@@ -14,10 +14,16 @@ fi
architecture="${ARCH:-${TRAVIS_CPU_ARCH:-$(uname -m)}}"
# Only use Xdebug if running as a cron job on Travis CI
xdebug=""
if [ "${TRAVIS_EVENT_TYPE}" != "cron" ]; then
xdebug="-without-xdebug"
fi
cmd_proxy=""
if [ "${architecture}" = "arm32" ]; then
image="benramsey/ramsey-uuid:php-${php_version}-arm32v7"
image="benramsey/ramsey-uuid:php-${php_version}-arm32v7${xdebug}"
volumes="-v ${PWD}:${PWD} -v ${HOME}/.composer/cache:/root/.composer/cache"
cmd_proxy="docker run --rm ${volumes} -w ${PWD} ${image}"
fi
+4
View File
@@ -2,6 +2,10 @@
set -e
if [ "${TRAVIS_EVENT_TYPE}" != "cron" ]; then
exit 0
fi
if [ -f vendor/bin/php-coveralls ]; then
php vendor/bin/php-coveralls -v
else