Hi all,
I'm working on a prototype using Symfony 3.
I'm not able to run tests through the pipelines service because I receive following errors. It seems the parameters.yml file that is generated in the yml file is not read.
[Doctrine\DBAL\Exception\DriverException]
An exception occurred in driver: could not find driver
[Doctrine\DBAL\Driver\PDOException]
could not find driver
[PDOException]
could not find driver
Can someone help me, please?
bitbucket-pipelines.yml
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.11
pipelines:
default:
- step:
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer -V
- composer install
- cp app/config/parameters.yml.dist app/config/parameters.yml
- "sed -i 's/database_port: ~/database_port: 3306/' app/config/parameters.yml"
- "sed -i 's/database_name: symfony/database_name: pipelines/' app/config/parameters.yml"
- "sed -i 's/database_user: root/database_user: test_user/' app/config/parameters.yml"
- "sed -i 's/database_password: ~/database_password: test_user_password/' app/config/parameters.yml"
- composer test
services:
- mysql
definitions:
services:
mysql:
image: mysql
environment:
MYSQL_DATABASE: 'pipelines'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_USER: 'test_user'
MYSQL_PASSWORD: 'test_user_password'
You need to install pdo_mysql in the docker image. This is very simple:
- apt-get update && apt-get install -y unzip mysql-client
- docker-php-ext-install pdo pdo_mysql
After this two steps pdo_mysql is available in your image.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.