I've read this Debug Pipelines locally with Docker but this bitbucket-pipelines.yml.
But this example doesn't use services within it's pipeline.
I'm developing a Lumen application and want to use BB pipelines to run my tests upon commit & push.
Running my unit & integration tests locally results in 100% succes but via BB pipelines I've some integration tests failing. So I want to debug locally first to see why some tests are failing.
But I need some help with the services
My bitbucket-pipelines.yml looks like this:
image: php:7-fpm
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -qy zlib1g-dev zip unzip git curl libmcrypt-dev mysql-client mcrypt
- docker-php-ext-install pdo_mysql && docker-php-ext-install zip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- cp .env-docker .env
- export CACHE_DRIVER=array
- export SESSION_DRIVER=array
- export DB_CONNECTION=mysql
- php artisan migrate
- vendor/bin/phpunit --verbose --exclude-group ignore --log-junit ./test-reports/junit.xml
services:
- mysql
definitions:
services:
mysql:
image: mysql
environment:
MYSQL_DATABASE: 'application_testing'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_USER: 'appuser'
MYSQL_PASSWORD: 'supersecretpassword'