【发布时间】:2019-07-26 12:15:45
【问题描述】:
在使用 gitlab CI/CD 构建我的 laravel 应用程序时,我遇到了以下异常:
Illuminate\Database\QueryException : 找不到驱动程序(SQL: select * from information_schema.tables where table_schema = xxx and table_name = xxx)
这是我的 .gitlab-yaml 文件:
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
请在下面找到我的 .env.test:
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
我做错了什么?我无法解决它。
【问题讨论】:
标签: php mysql laravel docker gitlab-ci