BlueGit

projects-timfalken-com verhalenboek

Files

verhalenboek / blue-ci-cd.yml

blue-ci-cd.yml

blue-ci-cd.yml 1.8 KiB Download Raw
1# BlueGit CI (git.timfalken.com). Secrets: timftp* from group projects.timfalken.com, projectftp from this repo (all protected: master only).
2stages:
3 - test
4 - deploy
5
6php_tests:
7 stage: test
8 image: php:8.3-cli-bookworm
9 before_script:
10 - apt-get update -qq
11 - apt-get install -y --no-install-recommends python3 libonig-dev
12 - docker-php-ext-install mbstring
13 script:
14 - find web -name '*.php' -not -path '*/artifacts/*' -print0 | xargs -0 -n1 php -l
15 - php -r 'foreach (["pdo_sqlite", "curl", "mbstring", "openssl"] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, "Missing extension " . $extension); exit(1); } }'
16 - php web/tests/storybook.php
17 - python3 web/tests/startup.py
18 - python3 web/tests/integration.py
19 - python3 web/tests/pwa.py
20
21frontend_checks:
22 stage: test
23 image: node:22-bookworm-slim
24 script:
25 - node --check web/assets/app.js
26 - node --check web/assets/pwa.js
27 - node --check web/sw.js
28
29# A real FTP fixture verifies that mirroring preserves production data and secrets.
30deploy_tests:
31 stage: test
32 image: debian:bookworm-slim
33 before_script:
34 - apt-get update -qq
35 - apt-get install -y --no-install-recommends python3 python3-pyftpdlib lftp ca-certificates openssh-client
36 script:
37 - python3 ci/test_deploy.py
38
39ftp_upload:
40 stage: deploy
41 image: debian:bookworm-slim
42 resource_group: production
43 environment:
44 name: production
45 # Deploy only after every test job passed; a failed test means no deploy.
46 needs: [php_tests, frontend_checks, deploy_tests]
47 rules:
48 - if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE != "merge_request_event"'
49 before_script:
50 - apt-get update -qq
51 - apt-get install -y --no-install-recommends python3 lftp ca-certificates openssh-client
52 script:
53 - python3 ci/deploy_guard.py
54 - python3 ci/deploy.py