CI/CD¶
CI/CD pipeline¶
The cprmv repository uses GitLab CI (.gitlab-ci.yml) with three stages: test, build, deploy.
Stages¶
test-cprmv-api (python:3.12-bookworm)
Runs on merge requests and pushes to main when serve_api/** files change:
- Installs
libxml2-devandlibxslt-dev. - Installs
requirements-dev.txt. - Syntax-checks
src/serve.pywithpy_compile. - Import-checks the FastAPI app.
- Verifies
data/cprmvmethods.ttlis present. - Runs
pytest.
build-cprmv-api (docker:24.0.5 with DinD)
Runs on pushes to main and develop when serve_api/** changes:
- On
main: builds and pushesdatafluisteraar/cprmv-api:latestanddatafluisteraar/cprmv-api:{commit-sha}. - On
develop: builds and pushesdatafluisteraar/cprmv-api:{branch-slug}.
Required CI/CD variables: DOCKER_HUB_USERNAME, DOCKER_HUB_TOKEN.
deploy-cprmv-api
Prints the new image tag and pull commands. Actual container restart is a manual step on the deployment host (run docker compose pull && docker compose up -d).
ReSpec publication¶
A separate job (create-pages) builds the ReSpec HTML specification from html/ using node:lts and publishes it to GitLab Pages at html/public.