gitlab cicd流水线 安装composer
最近在研究,流水线检查代码格式,workspace有什么镜像可以用吗?
我的配置还差点什么吗? 请有空的大佬们帮小弟瞅下,感激不尽
image: workspace:7.4
services:
- mariadb:10.2.14
- redis:5.0.10
.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:
files:
- platform/composer.json
paths:
- platform/storage
- platform/vendor
- platform/composer.lock
script:
- cd platform
# - apt-get install yum
# - yum install dnf
# - dnf -y install dnf-utils
# - dnf module install php:remi-7.4
# - dnf update
# - yum install php-xxx
# - systemctl start php-fpm.service
# - curl -sS https://getcomposer.org/installer | php
# - mv composer.phar /usr/local/bin/composer
- if [ ! -x "vendor" ];then
echo 'vendor not exists';
composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts;
else
echo 'vendor exists';
fi
- cp .env.example .env
- php artisan key:generate
- cat $OAUTH_PUBLIC > storage/oauth-public.key
- cat $OAUTH_PRIVATE > storage/oauth-private.key
artifacts:
expire_in: 7 day
paths:
- platform/.env
- platform/composer.lock
- platform/public/
- platform/storage/oauth-private.key
- platform/storage/oauth-public.key
store-npm-codestyle:
stage: test
script:
- cd platform
- composer run lint