image: php:7.4-fpm

pipelines:
    default:
        - step:
              name: Build and test
              caches:
                  - composer
              script:
                  - apt-get update && apt-get install -qy git curl libmcrypt-dev mariadb-client ghostscript
                  - yes | pecl install mcrypt-1.0.3
                  - docker-php-ext-install pdo_mysql bcmath exif
                  - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
                  - composer install
#                  - ln -f -s .env.pipelines .env
                  - php artisan migrate --force
              services:
                  - mysql
                  - redis
definitions:
    services:
        mysql:
            image: mysql:5.7
            environment:
                MYSQL_DATABASE: 'laravel-pipeline'
                MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
                MYSQL_USER: 'homestead'
                MYSQL_PASSWORD: 'secret'
        redis:
            image: redis
