CI/CD
GitLab CI + Docker Compose + Traefik.
Environments
| Environment | URL | Trigger |
|---|---|---|
| dev | https://dev-glamb.happydev.tech | Push to dev branch |
| production | https://glamb.happydev.tech | Push to main branch |
Pipeline Stages
test → dev/main → cleanup
| Job | Trigger | Action |
|---|---|---|
test-job | All branches | bundle exec rspec via ci-cd/test/ |
lint-job | All branches | rubocop without DB (parallel with test-job) |
lint-fix | Manual | rubocop -A + commit back to branch |
start-dev | dev branch | docker compose up -d ci-cd/dev/ |
start-main | main branch | docker compose up -d ci-cd/prod/ |
cleanup | Always | docker image prune -f |
test-job and lint-job run in parallel. Both must pass before deployment.
Git Flow
feature/* or fix/*
→ PR → dev (auto-deploy to dev environment)
→ PR → main (auto-deploy to production)
Required Secrets (GitLab CI Variables)
RAILS_MASTER_KEY
SECRET_KEY_BASE
DBUSER · DBPASS · DBNAME · DBPORT
ACTIVE_RECORD_KEY_SALT
ACTIVE_RECORD_PRIMARY_KEY
ACTIVE_RECORD_DETERMINISTIC_KEY
SWAGGER_USER · SWAGGER_PASSWORD # dev only
GIT_ACCESS_TOKEN # lint-fix only
Docker Files
| File | Purpose |
|---|---|
docker-compose.yml | Local development |
ci-cd/test/ | RSpec in pipeline |
ci-cd/dev/ | Deploy to dev server |
ci-cd/prod/ | Deploy to production |
ci-cd/lint/ | lint-fix with volume mount |
ci-cd/composes are never run locally.