Deconstructing an advanced .gitlab-ci.yml file

Now that we've configured GitLab to run continuous integration and continuous deployment with our example project, it's worth exploring a more advanced .gitlab-ci.yml file and breaking it down to make sure that we understand what all of the components do. To this end, here's an example file that uses more jobs and more advanced parameters:

image: bitnami/laravel:latestservices:  - postgres:9.6variables:  POSTGRES_DATABASE: postgres  POSTGRES_PASSWORD: password  DB_HOST: postgres  DB_USERNAME: rootstages:  - test  - package  - deployphp_unit_test:  stage: test  script:    - cp .env.example .env    - composer install    - php artisan key:generate    - php artisan migrate    - vendor/bin/phpunit  cache:    key: composer paths: ...

Get GitLab Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.