image: php:8.0-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 libfreetype6-dev libjpeg62-turbo-dev libpng-dev libzip-dev zip
          - docker-php-ext-configure gd --with-freetype --with-jpeg
          - docker-php-ext-install -j$(nproc) gd pdo_mysql bcmath exif zip
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer install
          - ln -f -s .env.pipelines .env
          - php artisan key:generate --force
          - php artisan migrate --seed --force
          - chmod -R 0755 bootstrap/cache
          # - ./vendor/bin/phpunit
          # - php artisan test
        services:
          - mysql
          - redis
definitions:
  services:
    mysql:
      image: mysql:5.7
      environment:
        MYSQL_DATABASE: 'creditegovt-pipeline'
        MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
        MYSQL_USER: 'pintop'
        MYSQL_PASSWORD: 'secret'
    redis:
      image: redis
