Basic gitlab CI
10K+
Docker images with everything you'll need to build and test PHP applications on Gitlab Continous Integration

7, 7.1, latest (7.1/Dockerfile) - 7.1-alpine (7.1/alpine/Dockerfile) - 7.1-fpm, fpm (7.1/fpm/Dockerfile) - 7.0 (7.0/Dockerfile) - 7.0-alpine (7.0/alpine/Dockerfile) - 7.0-fpm (7.0/fpm/Dockerfile) - 5.6 (5.6/Dockerfile) - 5.6-fpm (5.6/fpm/Dockerfile) - Debian versions come with Node 8.x, Alpine versions come with Node 6.x. All versions come with composer and yarn
These images come with PHP (with all laravel required extensions), Composer (with hirak/prestissimo to speed up), Node and Yarn.
Everything you need to test Laravel projects :D
Laravel test examples
.gitlab-ci.yml using mysql service# 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: edbizarro/gitlab-ci-pipeline-php:7.1-alpine
script:
- yarn
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr
.gitlab-ci.yml using mysql service, stages and cachestages:
- 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: edbizarro/gitlab-ci-pipeline-php:7.1-alpine
script:
- yarn config set cache-folder .yarn
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- 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: 1 days
when: always
deploy:
stage: deploy
image: edbizarro/gitlab-ci-pipeline-php:7.1
script:
- echo "Your deploy script"
only:
- master
when: on_success
Recommended
Special thanks to Ambientum, an incredible Brazilian project, for the inspiration.
Content type
Image
Digest
Size
300.8 MB
Last updated
almost 8 years ago
docker pull devfactorych/gitlab-ci-pipeline-php