69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
|
variables:
|
||
|
- &volumes
|
||
|
- node16_cache:/root/.npm
|
||
|
- /data/${CI_REPO}:/builds
|
||
|
|
||
|
when:
|
||
|
event: [push, pull_request, tag, manual]
|
||
|
branch: [master, master-*, develop, develop-*, feature/*]
|
||
|
|
||
|
steps:
|
||
|
db-wait:
|
||
|
image: gitnet.fr/deblan/timeout:latest
|
||
|
commands:
|
||
|
- /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
|
||
|
|
||
|
db-create:
|
||
|
image: mariadb:10.3
|
||
|
secrets: [mysqldump]
|
||
|
commands:
|
||
|
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
|
||
|
|
||
|
app-config:
|
||
|
image: deblan/php:8.1
|
||
|
commands:
|
||
|
- echo APP_ENV=prod >> .env.local
|
||
|
- echo APP_SECRET=$(openssl rand -hex 32) >> .env.local
|
||
|
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
|
||
|
|
||
|
php-composer:
|
||
|
image: deblan/php:8.1
|
||
|
commands:
|
||
|
- apt-get update && apt-get -y install git
|
||
|
- composer install --no-scripts
|
||
|
|
||
|
php-build:
|
||
|
image: deblan/php:8.1
|
||
|
environment:
|
||
|
- PHP=php
|
||
|
commands:
|
||
|
- ./bin/doctrine-migrate
|
||
|
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
|
||
|
|
||
|
node-build:
|
||
|
image: node:16-alpine
|
||
|
commands:
|
||
|
- make asset
|
||
|
|
||
|
security-check:
|
||
|
image: gitnet.fr/deblan/osv-detector:v0.9
|
||
|
commands:
|
||
|
- osv-detector composer.lock yarn.lock
|
||
|
failure: ignore
|
||
|
|
||
|
cache-build:
|
||
|
image: deblan/mage
|
||
|
volumes: *volumes
|
||
|
commands:
|
||
|
- cd /builds
|
||
|
- rsync -az "$CI_WORKSPACE/" "$CI_COMMIT_SHA"
|
||
|
|
||
|
services:
|
||
|
db:
|
||
|
image: mariadb:10.3
|
||
|
environment:
|
||
|
- MARIADB_ROOT_PASSWORD=root
|
||
|
|
||
|
volumes:
|
||
|
node16_cache:
|