CI/CD Integration
This repository uses GitLab CI/CD with two long-lived branches and two deployment targets.
Branch to Environment Mapping
acceptance
- Branch role: test and development branch
- Public URL:
https://translator.k.elnino-dev.com - Kubernetes profile:
dev - Namespace:
dev - Kubernetes resources keep the existing in-cluster names
- Image tags:
api:dev-<short_sha>web:dev-<short_sha>
main
- Branch role: production branch
- Public URL:
https://translator.k.elnino-prod.com - Kubernetes profile:
prod - Namespace:
acceptance - Kubernetes resources keep the existing in-cluster names
- Image tags:
api:prod-<short_sha>web:prod-<short_sha>
Pipeline Structure
The simplified GitLab pipeline is split into these stages:
testbuilddeploy
Test jobs
linttypechecktest-unitsecurity
Build jobs
build-apibuild-web
Deploy jobs
release-api-devdeploy-devrelease-api-proddeploy-prod
Release Flow
Acceptance branch flow
- Push to
acceptance - Run test and build jobs
- Deploy automatically to
dev
Main branch flow
- Push to
main - Run test and build jobs
- Wait for manual production release approval
- Deploy to
acceptance
Required GitLab CI/CD Variables
K8S_URLK8S_TOKENK8S_USERCI_REGISTRY_USERCI_REGISTRY_PASSWORDNEXT_PUBLIC_SENTRY_DSNSENTRY_ORGSENTRY_PROJECTSENTRY_AUTH_TOKEN
Application runtime variables should remain managed through the Kubernetes ConfigMaps and Secrets used by each namespace.
Best Practices
- Keep
acceptanceandmainprotected branches. - Use separate runtime values for the dev and prod releases, even if they deploy into existing namespaces.
- Keep production deployment manual unless your release policy requires full automation.
- Run database migration as a dedicated release job before the API rollout.
- Keep post-deploy verification in the pipeline so failures are visible immediately.