Skip to content

Instantly share code, notes, and snippets.

@purwandi
Forked from kevinvdburgt/.ci-installer.sh
Created December 19, 2015 19:05
Show Gist options
  • Save purwandi/cb6095add145ca4c02cd to your computer and use it in GitHub Desktop.
Save purwandi/cb6095add145ca4c02cd to your computer and use it in GitHub Desktop.
Laravel 5.1 - GitLab CI
#!/bin/bash
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
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/
@matrunchyk
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment