deblan.io-murph/.woodpecker/build.yml

90 lines
2.3 KiB
YAML
Raw Normal View History

2023-04-17 13:53:19 +02:00
variables:
2023-12-06 19:38:45 +01:00
volumes: &volumes
- node_cache:/root/.npm
2023-11-10 11:30:05 +01:00
- /data/${CI_REPO}:/builds
2023-04-17 13:53:19 +02:00
2023-09-22 22:07:17 +02:00
when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*]
2023-09-29 16:02:54 +02:00
steps:
2023-12-06 19:40:30 +01:00
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'
2023-12-06 19:38:45 +01:00
secrets:
image: gitnet.fr/deblan/novops
secrets: [vault_addr, vault_token]
commands:
- novops load -e build > .secrets
2023-09-13 20:55:40 +02:00
db-create:
image: mariadb:10.3
commands:
2023-12-06 19:40:30 +01:00
- . .secrets
2023-09-13 20:55:40 +02:00
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
2023-09-13 20:51:41 +02:00
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
2023-09-13 20:55:40 +02:00
php-composer:
image: deblan/php:8.1
commands:
- apt-get update && apt-get -y install git
- composer install --no-scripts
db-migrate:
image: deblan/php:8.1
environment:
- PHP=php
commands:
- ./bin/doctrine-migrate
app-jsroutes:
image: deblan/php:8.1
commands:
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
node-build:
image: node:16-alpine
environment:
- CPU_COUNT=3
volumes: *volumes
commands:
- apk add --no-cache git
- npm install -g svg2ttf ttf2eot ttf2woff2
- svg2ttf assets/fonts/deblan/src/deblan-icon.svg assets/fonts/deblan/deblan-icon.ttf
- cat assets/fonts/deblan/deblan-icon.ttf | ttf2woff2 > assets/fonts/deblan/deblan-icon.woff2
- ttf2eot assets/fonts/deblan/deblan-icon.ttf assets/fonts/deblan/deblan-icon.eot
- yarn
- test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json
- npm run build
security-check:
image: gitnet.fr/deblan/osv-detector:v0.9
commands:
- osv-detector composer.lock yarn.lock
failure: ignore
2022-12-28 15:24:57 +01:00
2023-09-13 21:10:18 +02:00
cache-build:
2023-10-18 22:17:06 +02:00
image: deblan/mage
2023-09-13 20:50:20 +02:00
volumes: *volumes
2022-12-28 16:11:40 +01:00
commands:
2023-10-18 22:16:10 +02:00
- cd /builds
2023-09-24 19:28:27 +02:00
- rsync -az "$CI_WORKSPACE/" "$CI_COMMIT_SHA"
2022-12-28 13:44:31 +01:00
2022-12-28 16:11:40 +01:00
services:
db:
image: mariadb:10.3
environment:
- MARIADB_ROOT_PASSWORD=root
2023-04-17 13:53:19 +02:00
volumes:
2023-12-06 19:38:45 +01:00
node_cache: