suivi/.woodpecker/build.yml
Simon Vieille caa2a9e7f8
Some checks failed
ci/woodpecker/push/build Pipeline failed
update node version
2024-03-29 13:46:18 +01:00

69 lines
1.6 KiB
YAML

variables:
- &volumes
- /data/${CI_REPO}:/builds
when:
event: [push, pull_request, tag, manual]
branch: [master, develop]
steps:
"Wait the database":
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'
"Create database":
image: mariadb:10.3
commands:
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
"Configure app":
image: deblan/php:8.0
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
"Installs PHP dependencies":
image: deblan/php:8.0
commands:
- apt-get update && apt-get -y install git
- composer install --no-scripts
"Migrates database":
image: deblan/php:8.0
environment:
- PHP=php
commands:
- ./bin/doctrine-migrate
"Generates JS routes":
image: deblan/php:8.0
commands:
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
"Build assets":
image: node:21-alpine
commands:
- yarn
- npm run build
"Check dependencies":
image: gitnet.fr/deblan/osv-detector:v0.9
commands:
- osv-detector composer.lock yarn.lock
failure: ignore
"Build the cache":
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