[wip] events

This commit is contained in:
Simon Vieille 2023-09-13 21:10:18 +02:00
parent ed8319f727
commit e70764e63d
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -9,6 +9,9 @@ pipeline:
image: gitnet.fr/deblan/timeout:latest image: gitnet.fr/deblan/timeout:latest
commands: 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' - /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*]
db-create: db-create:
image: mariadb:10.3 image: mariadb:10.3
@ -17,6 +20,7 @@ pipeline:
- mysql -hdb -uroot -proot -e "CREATE DATABASE app" - mysql -hdb -uroot -proot -e "CREATE DATABASE app"
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app - eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
app-config: app-config:
@ -26,6 +30,7 @@ pipeline:
- echo APP_SECRET=$(openssl rand -hex 32) >> .env.local - echo APP_SECRET=$(openssl rand -hex 32) >> .env.local
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local - echo DATABASE_URL=mysql://root:root@db/app >> .env.local
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
php-composer: php-composer:
@ -33,6 +38,8 @@ pipeline:
commands: commands:
- apt-get update && apt-get -y install git - apt-get update && apt-get -y install git
- composer install --no-scripts - composer install --no-scripts
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*]
db-migrate: db-migrate:
image: deblan/php:8.1 image: deblan/php:8.1
@ -41,6 +48,7 @@ pipeline:
commands: commands:
- ./bin/doctrine-migrate - ./bin/doctrine-migrate
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
app-jsroutes: app-jsroutes:
@ -48,6 +56,7 @@ pipeline:
commands: commands:
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json - php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
node-build: node-build:
@ -65,6 +74,7 @@ pipeline:
- test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json - test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json
- npm run build - npm run build
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
security-check: security-check:
@ -73,15 +83,17 @@ pipeline:
- osv-detector composer.lock yarn.lock - osv-detector composer.lock yarn.lock
failure: ignore failure: ignore
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
build_cache: cache-build:
image: deblan/php:8.1 image: deblan/php:8.1
volumes: *volumes volumes: *volumes
commands: commands:
- cd /data/deblan/deblan.io-murph/ - cd /data/deblan/deblan.io-murph/
- mv "$CI_WORKSPACE" "$CI_COMMIT_SHA" - mv "$CI_WORKSPACE" "$CI_COMMIT_SHA"
when: when:
event: [push, pull_request, tag, manual]
branch: [master, master-*, develop, develop-*, feature/*] branch: [master, master-*, develop, develop-*, feature/*]
app-deploy: app-deploy:
@ -103,6 +115,16 @@ pipeline:
when: when:
event: [deployment] event: [deployment]
cache-clean:
image: deblan/php:8.1
volumes: *volumes
commands:
- cd /data/deblan/deblan.io-murph/
- rm * -frv
when:
event: cron
cron: cache-clean
services: services:
db: db:
image: mariadb:10.3 image: mariadb:10.3