-
-
Save kevinvdburgt/1dcc69d1078884bcb28d to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# Moved to: https://github.com/kevinvdburgt/Laravel-GitLab-CI | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash | |
. ~/.nvm/nvm.sh | |
nvm install 0.12 | |
nvm alias default 0.12 | |
npm config set cache-min 86400 | |
npm config set cache /cache/node_modules/ | |
npm install -g gulp | |
npm install |
# Moved to: https://github.com/kevinvdburgt/Laravel-GitLab-CI | |
image: tetraweb/php:5.6-cli | |
services: | |
- mysql | |
variables: | |
WITH_XDEBUG: "1" | |
MYSQL_ROOT_PASSWORD: secret | |
MYSQL_DATABASE: homestead | |
MYSQL_USER: homestead | |
MYSQL_PASSWORD: secret | |
COMPOSER_HOME: /cache/composer | |
stages: | |
- linter | |
- test | |
php-5.5: | |
type: test | |
image: tetraweb/php:5.5-cli | |
script: | |
- docker-php-ext-enable zip | |
- docker-php-ext-enable mbstring | |
- docker-php-ext-enable pdo_mysql | |
- php -v | |
- composer self-update | |
- composer install --no-progress --no-interaction | |
- cp .env.example .env | |
- sed -i.bak 's/DB_HOST=localhost/DB_HOST=mysql/g' .env | |
- php artisan key:generate | |
- php artisan migrate:refresh | |
- php artisan db:seed | |
- source .ci-installer.sh | |
- gulp | |
- php vendor/bin/phpunit --colors --coverage-text | |
php-5.6: | |
type: test | |
image: tetraweb/php:5.6-cli | |
script: | |
- docker-php-ext-enable zip | |
- docker-php-ext-enable mbstring | |
- docker-php-ext-enable pdo_mysql | |
- php -v | |
- composer self-update | |
- composer install --no-progress --no-interaction | |
- cp .env.example .env | |
- sed -i.bak 's/DB_HOST=localhost/DB_HOST=mysql/g' .env | |
- php artisan key:generate | |
- php artisan migrate:refresh | |
- php artisan db:seed | |
- source .ci-installer.sh | |
- gulp | |
- php vendor/bin/phpunit --colors --coverage-text | |
php-7.0: | |
type: test | |
image: tetraweb/php:7.0-cli | |
script: | |
- docker-php-ext-enable zip | |
- docker-php-ext-enable mbstring | |
- docker-php-ext-enable pdo_mysql | |
- php -v | |
- composer self-update | |
- composer install --no-progress --no-interaction | |
- cp .env.example .env | |
- sed -i.bak 's/DB_HOST=localhost/DB_HOST=mysql/g' .env | |
- php artisan key:generate | |
- php artisan migrate:refresh | |
- php artisan db:seed | |
- source .ci-installer.sh | |
- gulp | |
- php vendor/bin/phpunit --colors --coverage-text | |
allow_failure: true | |
phpcs: | |
type: linter | |
image: tetraweb/php:5.6-cli | |
script: | |
- php -v | |
- phpcs --version | |
- phpcs -p --standard=PSR2 --ignore="app/helpers.php,app/Http/routes.php" app/ | |
eslint-node-4.2.1: | |
type: linter | |
image: node:4.2.1 | |
script: | |
- source .ci-installer.sh | |
- npm install -g eslint eslint-config-airbnb eslint-loader eslint-plugin-react babel-eslint > /dev/null | |
- eslint resources/assets/js/ |
Also you can merge docker-php-ext-enable
into one line like docker-php-ext-enable mbstring pdo_mysql zip
Thanks for sharing, I've got a question however, how do you get the migrations to work in the docker container keep getting:
$ php artisan migrate:refresh
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
ERROR: Build failed with: exit code 1
@abcdmitry, thanks for your input! I have moved those CI files to a git repository (See: https://github.com/kevinvdburgt/Laravel-GitLab-CI)
@andrefigueira i have moved (and upgraded) the CI scripts, see: https://github.com/kevinvdburgt/Laravel-GitLab-CI
@kevinvdburgt, Now this repo is deleted 😢
@leon0399 First, sorry for the delayed answer. I've removed the repo because is was realy outdated and stopped using GitLab back then. Went back to a paid version of GitHub and using it with CircleCI now :)
Please get rid of
-cli
suffixes since they are not supported anymoretetraweb/php:5.5-cli
->tetraweb/php:5.5
. See CHANGELOG for details