Skip to content

Instantly share code, notes, and snippets.

@iolson
Created September 22, 2015 22:52
Show Gist options
  • Save iolson/a60c5f238b90f411bec3 to your computer and use it in GitHub Desktop.
Save iolson/a60c5f238b90f411bec3 to your computer and use it in GitHub Desktop.
GitLab CI Runner
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
# Services
services:
- mysql:latest
# Variables
variables:
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
# PHP 5.5
php:5.5:
image: bobey/docker-gitlab-ci-runner-php5.5
script:
- echo "Running PHPUnit Tests"
- php vendor/bin/phpunit --colors --debug --coverage-text
# PHP 5.6
php:5.6:
image: bobey/docker-gitlab-ci-runner-php5.6
script:
- echo "Running PHPUnit Tests"
- php vendor/bin/phpunit --colors --debug --coverage-text
[[runners]]
name = "php"
url = "gitlab-url"
token = "token"
limit = 1
executor = "docker"
environment = ["MYSQL_ALLOW_EMPTY_PASSWORD=1", "COMPOSER_GITHUB=composer-token"]
[runners.docker]
image = ""
wait_for_services_timeout = 0
allowed_images = ["*", "*/*"]
allowed_services = ["*", "*/*"]
privileged = false
volumes = ["/cache", "/composer-auth.json:/root/.composer/auth.json:ro"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment