Docker images with everything you'll need to build and test PHP applications.
Based on Official PHP images
PHP 8.0 available!
-
8.0
,8
,latest
(8.0/Dockerfile) - -
8.0-fpm
,fpm
(8.0/fpm/Dockerfile) -
All versions come with Node 14, Composer and Yarn
All images come with PHP (with all laravel required extensions), Composer (with hirak/prestissimo to speed up installs), Node and Yarn.
Everything you need to test Laravel projects :D
# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
test:
stage: test
services:
- mysql:5.7
image: rjvandoesburg/gitlab-ci-pipeline-php:8.0
script:
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr
stages:
- test
- deploy
# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
# Speed up builds
cache:
key: $CI_BUILD_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x
paths:
- vendor
- node_modules
- public
- .yarn
test:
stage: test
services:
- mysql:5.7
image: rjvandoesburg/gitlab-ci-pipeline-php:8.0
script:
- yarn config set cache-folder .yarn
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr
artifacts:
paths:
- ./storage/logs # for debugging
expire_in: 7 days
when: always
deploy:
stage: deploy
image: rjvandoesburg/gitlab-ci-pipeline-php:8.0-alpine
script:
- echo "Deploy all the things!"
only:
- master
when: on_success