While building my laravel application using gitlab CI/CD ,I am getting the following exception:
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = xxx and table_name = xxx)
Here is my .gitlab-yaml file:
image: php:7.2
services:
- name: mysql:5.7
variables:
WITH_XDEBUG: "1"
DB_HOST: mysql
DB_USERNAME: root
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: xxx
MYSQL_DATABASE: xxx
stages:
- build
- test
building:
stage: build
image: php:7.2
script:
- cp .env.test .env
- php artisan config:clear
- php artisan migrate:refresh
- php artisan db:seed
artifacts:
expire_in: 1 month
paths:
- vendor/
- .env
phpunit:
stage: test
image: php:7.2
script:
- ./vendor/bin/phpunit --colors --verbose --configuration phpunit.xml
Please find my .env.test below:
APP_ENV=local
APP_DEBUG=true
APP_KEY=somestring
DB_CONNECTION=mysql
DB_HOST=mysql
DB_DATABASE=xxx
DB_USERNAME=xxx
DB_PASSWORD=xxx
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=xxx
What am I doing wrong? I can't be able to resolve it.