Hi,
I use GitlabCI with my Symfony app. The database is not create. So my composer install command doesn’t work because the database is required.
This is my configuration :
phpunit:
image: php:7.1
services:
- mysql:latest
variables:
WITH_XDEBUG: "1"
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: gitlab_test_db
MYSQL_USER: runner
MYSQL_PASSWORD: password
before_script:
- apt-get update -yqq
- apt-get install -yqq git zip unzip
- docker-php-ext-install pdo_mysql
# Installation de Composer
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
# Mise en place de la configuration
- cp app/config/parameters.yml.dist app/config/parameters.yml
# Installation des dépendances
- php composer.phar install --prefer-source --no-interaction --ignore-platform-reqs # > Problem here because not db
# Installation de la db de test
- php bin/console doctrine:database:create -e test
- php bin/console doctrine:schema:update -f -e test
- php bin/console doctrine:fixtures:load --no-interaction -e test
script:
# Lancement des tests PHP
- bin/phpunit -d memory_limit=-1
How to create database ?
Regards,