Last active
April 29, 2017 18:06
-
-
Save iolson/3936da49e8b3b4f441e1 to your computer and use it in GitHub Desktop.
GitLab CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before Tests | |
before_script: | |
- bash ci/docker_install.sh > /dev/null | |
- composer self-update | |
- composer install --prefer-dist > /dev/null | |
- cp .env.gitlab .env | |
- php artisan key:generate | |
- php artisan migrate:refresh | |
# Services | |
services: | |
- mysql:latest | |
# Variables | |
variables: | |
MYSQL_USER: homestead | |
MYSQL_PASSWORD: secret | |
MYSQL_DATABASE: homestead | |
# PHP 5.6 Apache | |
php:5.6-apache: | |
image: php:5.6-apache | |
script: | |
- phpunit --colors --debug --coverage-text | |
# PHP 5.6 FPM | |
php:5.6-fpm: | |
image: php:5.6-fpm | |
script: | |
- phpunit --colors --debug --coverage-text | |
# PHP 7.0 Apache | |
php:7-apache: | |
image: php:7-apache | |
script: | |
- phpunit --colors --debug --coverage-text | |
# PHP 7.0 FPM | |
php:7-fpm: | |
image: php:7-fpm | |
script: | |
- phpunit --colors --debug --coverage-text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# We need to install dependencies only for Docker | |
[[ ! -e /.dockerinit ]] && exit 0 | |
set -xe | |
# Update | |
apt-get update -yqq | |
# Git | |
apt-get install git -yqq | |
# Zlib | |
apt-get install zlib1g-dev | |
# PHPUnit | |
curl -o /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar | |
chmod +x /usr/local/bin/phpunit | |
# PHP Extensions | |
docker-php-ext-install pdo_mysql | |
docker-php-ext-install mbstring | |
docker-php-ext-install zip | |
# Composer | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer |
Yes, you have to make your mysql host: mysql instead of localhost.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you connect to mysql container ? I try to use your script, it's seems can't connect to mysql container :(