Gitlab CI pipeline for PHP applications
Docker image with everything you'll need to build and test PHP applications on Gitlab Continous Integration
Official docker repository
Docker Hub: https://hub.docker.com/r/dockerphp/nginx/
Supported tags
Based on Official PHP images Alpine and all versions come with:
- Dependency Manager:
- Automation of tasks:
- PHP Quality Assurance:
First of all you must have installed gitlab-ci-runner
Usage
Simple usage
Acces to the container console easily:
docker run --rm -ti -v /your/project:/app dockerphp/gitlab-ci-pipeline:7.1 sh
Configuration of your jobs with .gitlab-ci.yml
Basic configuration
image: dockerphp/gitlab-ci-pipeline:7.1
cache:
paths:
- vendor/
variables:
COMPOSER_DISABLE_XDEBUG_WARN: "1"
COMPOSER_ALLOW_SUPERUSER: "1"
test:app:
script:
- composer install --prefer-dist --no-interaction --no-progress
- ./vendor/bin/phpunit --coverage-text --colors=never
- ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
mariadb
service and Make
Using the variables:
COMPOSER_DISABLE_XDEBUG_WARN: "1"
COMPOSER_ALLOW_SUPERUSER: "1"
MYSQL_ROOT_PASSWORD: ci
MYSQL_USER: ci
MYSQL_PASSWORD: ci
MYSQL_DATABASE: ci
DB_HOST: mariadb
test:
stage: test
services:
- mariadb:10.3
image: dockerphp/gitlab-ci-pipeline:7.0
script:
- make test
Multi versions and Apache-Ant
cache:
paths:
- vendor/
variables:
COMPOSER_DISABLE_XDEBUG_WARN: "1"
COMPOSER_ALLOW_SUPERUSER: "1"
stages:
- test
test:7.1:
image: dockerphp/gitlab-ci-pipeline:7.1
script:
- ant -Dbasedir=`pwd` -buildfile build/ci_gitlab.xml
test:7.0:
image: dockerphp/gitlab-ci-pipeline:7.0
script:
- ant -Dbasedir=`pwd` -buildfile build/ci_gitlab.xml
License
This project is released under the MIT License, you agree to license your code under the MIT license