Files
exchange/.gitlab-ci.sh
2018-06-23 01:23:21 +08:00

44 lines
1.2 KiB
Bash

#!/bin/bash
# Install dependencies only for Docker.
[[ ! -e /.dockerenv ]] && exit 0
set -xe
# Update packages and install composer and PHP dependencies.
apt-get update -y && apt-get install -y openssl zip unzip git zlib1g-dev netcat mysql-client libgd-dev libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
# Compile PHP, include these extensions.
# docker-php-ext-install mbstring pdo_mysql curl json intl gd xml zip bz2 opcache
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
docker-php-ext-install pdo pdo_mysql zip gd
# Install Composer and project dependencies.
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Update dependencies
composer install
# Copy over testing configuration.
cp .env.testing .env
# Install xdebug
pecl install xdebug && docker-php-ext-enable xdebug
# Generate an application key. Re-cache.
php artisan key:generate
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
php artisan jwt:secret
php artisan config:cache
php artisan config:clear
# Run database migrations with seeder
php artisan migrate:refresh --seed
# clear class map
php artisan clear-compiled
composer dump-autoload