23 lines
902 B
Bash
23 lines
902 B
Bash
|
#!/bin/bash
|
||
|
# From https://docs.gitlab.com/ee/ci/examples/php.html
|
||
|
|
||
|
# We need to install dependencies only for Docker
|
||
|
[[ ! -e /.dockerenv ]] && exit 0
|
||
|
|
||
|
set -xe
|
||
|
|
||
|
# Install git (the php image doesn't have it) which is required by composer
|
||
|
apt-get update -yqq
|
||
|
apt-get install git wget unzip -yqq
|
||
|
|
||
|
# Install & enable Xdebug for code coverage reports
|
||
|
pecl install xdebug
|
||
|
docker-php-ext-enable xdebug
|
||
|
|
||
|
# Install composer dependencies
|
||
|
wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
|
||
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||
|
php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||
|
php composer-setup.php
|
||
|
php -r "unlink('composer-setup.php'); unlink('installer.sig');"
|
||
|
php composer.phar install
|