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:latest
services:
- postgres:9.6
variables:
POSTGRES_DATABASE: postgres
POSTGRES_PASSWORD: password
DB_HOST: postgres
DB_USERNAME: root
stages:
- test
- package
- deploy
php_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:
- vendor/
js_unit_test:
stage: test
script:
- npm install
- npm run test
package_upload...