Update .gitlab-ci.yml
This commit is contained in:
@@ -1,20 +1,58 @@
|
|||||||
FROM php:7.4
|
image: lorisleiva/laravel-docker:latest
|
||||||
|
|
||||||
# Update packages
|
# Replace the last line with the following lines if you'd rather
|
||||||
RUN apt-get update
|
# leave StrictHostKeyChecking enabled (replace yourdomain.com):
|
||||||
|
#
|
||||||
|
# ssh-keyscan yourdomain.com >> ~/.ssh/known_hosts
|
||||||
|
# chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
.change_file_permissions: &change_file_permissions |
|
||||||
|
find . -type f -not -path "./vendor/*" -exec chmod 664 {} \;
|
||||||
|
find . -type d -not -path "./vendor/*" -exec chmod 775 {} \;
|
||||||
|
|
||||||
|
composer:
|
||||||
|
stage: build
|
||||||
|
cache:
|
||||||
|
key: ${CI_COMMIT_REF_SLUG}-composer
|
||||||
|
paths:
|
||||||
|
- vendor/
|
||||||
|
script:
|
||||||
|
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
|
||||||
|
- cp .env.example .env
|
||||||
|
- php artisan key:generate
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 month
|
||||||
|
paths:
|
||||||
|
- vendor/
|
||||||
|
- .env
|
||||||
|
|
||||||
# Install PHP and composer dependencies
|
npm:
|
||||||
RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev
|
stage: build
|
||||||
|
cache:
|
||||||
|
key: ${CI_COMMIT_REF_SLUG}-npm
|
||||||
|
paths:
|
||||||
|
- node_modules/
|
||||||
|
script:
|
||||||
|
- npm install
|
||||||
|
- npm run production
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 month
|
||||||
|
paths:
|
||||||
|
- node_modules/
|
||||||
|
- public/css/
|
||||||
|
- public/js/
|
||||||
|
|
||||||
# Clear out the local repository of retrieved package files
|
|
||||||
RUN apt-get clean
|
|
||||||
|
|
||||||
# Install needed extensions
|
codestyle:
|
||||||
# Here you can install any other extension that you need during the test and deployment process
|
stage: test
|
||||||
RUN docker-php-ext-install mcrypt pdo_mysql zip
|
dependencies: []
|
||||||
|
script:
|
||||||
|
- phpcs --standard=PSR2 --extensions=php --ignore=app/Support/helpers.php app
|
||||||
|
|
||||||
|
phpunit:
|
||||||
|
stage: test
|
||||||
|
dependencies:
|
||||||
|
- composer
|
||||||
|
script:
|
||||||
|
- phpunit --coverage-text --colors=never
|
||||||
|
|
||||||
# Install Composer
|
|
||||||
RUN curl --silent --show-error "https://getcomposer.org/installer" | php -- --install-dir=/usr/local/bin --filename=composer
|
|
||||||
|
|
||||||
# Install Laravel Envoy
|
|
||||||
RUN composer global require "laravel/envoy=~1.0"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user