BlueGit

projects-timfalken-com microchess

Pipeline Editor

Pipelines Pipeline Editor

Pipeline Editor

No issues found

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
# BlueGit CI (vertaald uit .gitlab-ci.yml; GitLab is alleen nog backup).
# Secrets (repo, beschermd, gekopieerd van GitLab): timftphost, timftpuser, timftppassword, timftproot, projectftp.
stages:
- test
- deploy
php_tests:
stage: test
image: php:8.3-cli-bookworm
before_script:
- apt-get update -qq
- apt-get install -y --no-install-recommends python3 libonig-dev
- docker-php-ext-install mbstring
script:
- find web -name '*.php' -not -path '*/artifacts/*' -print0 | xargs -0 -n1 php -l
- php -r 'foreach (["pdo_sqlite", "curl", "mbstring", "openssl"] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, "Missing extension " . $extension); exit(1); } }'
- php web/tests/chess.php
- php web/tests/colors.php
- php web/tests/feedback.php
- php web/tests/push.php
- python3 web/tests/startup.py
- python3 web/tests/integration.py
frontend_checks:
stage: test
image: node:22-bookworm-slim
script:
- node --check web/assets/app.js
- node --check web/assets/pwa.js
- node --check web/sw.js
- node web/tests/pwa.mjs
- node --check web/tests/browser.mjs
# A real FTP fixture verifies that mirroring preserves production data and secrets.
deploy_tests:
stage: test
image: debian:bookworm-slim
before_script:
- apt-get update -qq
- apt-get install -y --no-install-recommends python3 python3-pyftpdlib lftp ca-certificates openssh-client
script:
- python3 ci/test_deploy.py
ftp_upload:
stage: deploy
image: debian:bookworm-slim
resource_group: production
environment:
name: production
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE != "merge_request_event"'
before_script:
- apt-get update -qq
- apt-get install -y --no-install-recommends python3 lftp ca-certificates openssh-client
script:
# BlueGit expandeert $timftproot in secrets niet (GitLab deed dat wel).
- export projectftp="$(python3 -c 'import os;r=os.environ.get("timftproot","");print(os.environ["projectftp"].replace("${timftproot}",r).replace("$timftproot",r))')"
- python3 ci/deploy.py