Loading README.md +7 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ the image. For this, you may use the following files (located in `PHP_PROJECT_DIR`): * `.php_apt_get` containing required system libraries (in a single line), * `.php_apt_get` and `.php_apk` containing required system libraries (in a single line), * `.php_pecl` containing required PECL extensions (in a single line), * `.php_ext` containing required PHP extensions (in a single line). Loading @@ -68,6 +68,12 @@ Example: a project requires `php-gd` and `php-zip` extensions (themselves requir libzip-dev libpng-dev ``` `.php_apk`: ```text libzip-dev libpng-dev ``` `.php_ext`: ```text Loading templates/gitlab-ci-php.yml +29 −19 Original line number Diff line number Diff line Loading @@ -259,22 +259,41 @@ stages: # install PHP system dependencies function install_project_deps() { if command -v apt-get >/dev/null 2>&1 then # install zip & unzip (required to unzip dist packages) git (required by composer) apt-get update -yqq apt-get install zip unzip git -yqq if [[ -f ".php_apt_get" ]] then log_info "file \\e[33;1m.php_apt_get\\e[0m found: install project system dependencies..." # shellcheck disable=SC2046 apt-get install -yqq $(cat .php_apt_get) fi fi if [[ -f ".php_pecl" ]] if command -v apk >/dev/null 2>&1 then log_info "file \\e[33;1m.php_pecl\\e[0m file found: install project extensions..." # install zip & unzip (required to unzip dist packages) git (required by composer) linux-headers $PHPIZE_DEPS (required by pecl) # shellcheck disable=SC2086 apk --update -q add zip unzip git linux-headers $PHPIZE_DEPS if [[ -f ".php_apk" ]] then log_info "file \\e[33;1m.php_apk\\e[0m found: install project system dependencies..." # shellcheck disable=SC2046 apk add -q $(cat .php_apk) fi fi # set proxy for pear # shellcheck disable=SC2154 if [[ "${http_proxy}" ]]; then pear config-set http_proxy "${http_proxy}" fi if [[ -f ".php_pecl" ]] then log_info "file \\e[33;1m.php_pecl\\e[0m file found: install project extensions..." # shellcheck disable=SC2046 pecl install $(cat .php_pecl) fi Loading Loading @@ -338,9 +357,6 @@ stages: - !reference [.php-scripts] - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" - cd $PHP_PROJECT_DIR # install zip & unzip (required to unzip dist packages) git (required by composer) - apt-get update -yqq - apt-get install zip unzip git -yqq # install project system dependencies (if any) - install_project_deps # install project dependencies Loading @@ -358,12 +374,6 @@ php-unit: stage: build script: # install Xdebug - | # set proxy for pear if [[ "${http_proxy}" ]]; then pear config-set http_proxy "${http_proxy}" fi - pecl install xdebug - docker-php-ext-enable xdebug - set_xdebug_mode Loading Loading
README.md +7 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ the image. For this, you may use the following files (located in `PHP_PROJECT_DIR`): * `.php_apt_get` containing required system libraries (in a single line), * `.php_apt_get` and `.php_apk` containing required system libraries (in a single line), * `.php_pecl` containing required PECL extensions (in a single line), * `.php_ext` containing required PHP extensions (in a single line). Loading @@ -68,6 +68,12 @@ Example: a project requires `php-gd` and `php-zip` extensions (themselves requir libzip-dev libpng-dev ``` `.php_apk`: ```text libzip-dev libpng-dev ``` `.php_ext`: ```text Loading
templates/gitlab-ci-php.yml +29 −19 Original line number Diff line number Diff line Loading @@ -259,22 +259,41 @@ stages: # install PHP system dependencies function install_project_deps() { if command -v apt-get >/dev/null 2>&1 then # install zip & unzip (required to unzip dist packages) git (required by composer) apt-get update -yqq apt-get install zip unzip git -yqq if [[ -f ".php_apt_get" ]] then log_info "file \\e[33;1m.php_apt_get\\e[0m found: install project system dependencies..." # shellcheck disable=SC2046 apt-get install -yqq $(cat .php_apt_get) fi fi if [[ -f ".php_pecl" ]] if command -v apk >/dev/null 2>&1 then log_info "file \\e[33;1m.php_pecl\\e[0m file found: install project extensions..." # install zip & unzip (required to unzip dist packages) git (required by composer) linux-headers $PHPIZE_DEPS (required by pecl) # shellcheck disable=SC2086 apk --update -q add zip unzip git linux-headers $PHPIZE_DEPS if [[ -f ".php_apk" ]] then log_info "file \\e[33;1m.php_apk\\e[0m found: install project system dependencies..." # shellcheck disable=SC2046 apk add -q $(cat .php_apk) fi fi # set proxy for pear # shellcheck disable=SC2154 if [[ "${http_proxy}" ]]; then pear config-set http_proxy "${http_proxy}" fi if [[ -f ".php_pecl" ]] then log_info "file \\e[33;1m.php_pecl\\e[0m file found: install project extensions..." # shellcheck disable=SC2046 pecl install $(cat .php_pecl) fi Loading Loading @@ -338,9 +357,6 @@ stages: - !reference [.php-scripts] - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" - cd $PHP_PROJECT_DIR # install zip & unzip (required to unzip dist packages) git (required by composer) - apt-get update -yqq - apt-get install zip unzip git -yqq # install project system dependencies (if any) - install_project_deps # install project dependencies Loading @@ -358,12 +374,6 @@ php-unit: stage: build script: # install Xdebug - | # set proxy for pear if [[ "${http_proxy}" ]]; then pear config-set http_proxy "${http_proxy}" fi - pecl install xdebug - docker-php-ext-enable xdebug - set_xdebug_mode Loading