BlueGit

projects-timfalken-com verhalenboek

Files

verhalenboek / blue-ci-cd.yml

blue-ci-cd.yml

blue-ci-cd.yml 1.9 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 - python3 web/tests/feed.py
21
22frontend_checks:
23 stage: test
24 image: node:22-bookworm-slim
25 script:
26 - node --check web/assets/app.js
27 - node --check web/assets/pwa.js
28 - node --check web/sw.js
29
30# A real FTP fixture verifies that mirroring preserves production data and secrets.
31deploy_tests:
32 stage: test
33 image: debian:bookworm-slim
34 before_script:
35 - apt-get update -qq
36 - apt-get install -y --no-install-recommends python3 python3-pyftpdlib lftp ca-certificates openssh-client
37 script:
38 - python3 ci/test_deploy.py
39
40ftp_upload:
41 stage: deploy
42 image: debian:bookworm-slim
43 resource_group: production
44 environment:
45 name: production
46 # Deploy only after every test job passed; a failed test means no deploy.
47 needs: [php_tests, frontend_checks, deploy_tests]
48 rules:
49 - if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE != "merge_request_event"'
50 before_script:
51 - apt-get update -qq
52 - apt-get install -y --no-install-recommends python3 lftp ca-certificates openssh-client
53 script:
54 - python3 ci/deploy_guard.py
55 - python3 ci/deploy.py