Public | Automated Build

Last pushed: a year ago
Short Description
An image for building PHP projects with MySQL on Bitbucket Pipelines
Full Description

PHP 7 and MySQL for Bitbucket Pipelines

Bitbucket Pipelines require everything to be in a single image meaning you can't do it The Docker Way™ and split all of your services up into individual containers.

The image contains most things you need to test a PHP application.


Here's an example installing a Laravel application, running the tests with a Composer locked version of PHPUnit and pushing code coverage information to Codecov:

image: punkstar/bitbucket-pipelines-php7-mysql
    - step:
          - php -r "file_exists('.env') || copy('', '.env');"
          - service mysql start
          - mysql -h localhost -u root -proot -e "CREATE DATABASE test;"
          - mv /etc/php/7.0/cli/conf.d/20-xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini.disabled
          - composer config -g lalalalalala
          - composer install --no-interaction --no-progress --prefer-dist
          - php artisan key:generate
          - php artisan migrate
          - mv /etc/php/7.0/cli/conf.d/20-xdebug.ini.disabled /etc/php/7.0/cli/conf.d/20-xdebug.ini
          - vendor/bin/phpunit --coverage-clover=coverage.xml
          - if [ $? -eq 0 ]; then bash <(curl -s; fi
Docker Pull Command